GRChandrashekar
asked on
Load textfrom from gridview selected row
I am trying to load textbox from selected keydown of gridview
tried both ways as under but no luck
bxtitleid.Text = dgridtitle.Item("TitleID", dgridtitle.CurrentRow.Inde x).Value
tbxdescription.Text = dgridtitle.SelectedRows(0) .Cells("DE SCRIPTION" ).Value.To String()
it was column name not valid
tried both ways as under but no luck
bxtitleid.Text = dgridtitle.Item("TitleID",
tbxdescription.Text = dgridtitle.SelectedRows(0)
it was column name not valid
ASKER
Tried that also
what are you getting?
ASKER
Column named Titleid cannot be found.
Parameter name: columnName
I copied from griddata property name and pasted so that name is right still error
Parameter name: columnName
I copied from griddata property name and pasted so that name is right still error
when u debug your code, before this line, put dgv.Columns in the Watch window and see if the collection contains "Titleid"
ASKER
It is there
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Yes I have taken Name property of the Column
ASKER
This works :
dgridtitle.SelectedRows(0) .Cells("Ti tleidDataG ridViewTex tBoxColumn ").Value.T oString()
But is this the way ?
dgridtitle.SelectedRows(0)
But is this the way ?
where TitleidDataGridViewTextBox Column came from?
ASKER
copied from grid view design-name
great, as long as its working
Open in new window
FYI, make sure the column name is case sensitive.