Click to See Complete Forum and Search --> : Datagrid Selection in asp.net


karthik_balus
March 18th, 2006, 01:53 AM
I have a query... I have connected back end.... I have placed datagrid for a table.... But i need to select a particular dta from that datagrid control and want to print that in a text box...

Consider a table in back end which has the table name party_master.. its fields are 'party_id' and 'party_name'....

Insert 4 values inside the table....

And develop a datagrid control...

Add a button control and a text control....

When we press the button control the datagrid should be displayed... When we select a particular data from party_id in datagrid it should be placed in textbox control as a text...

I have tried a lot with this coding inside the datagrid control...

TextBox1.Text=DataGrid1.SelectedItem.Text...

But .TExt is not appearing.... Please help out in this....

I need to complete this within today...

mcmcom
March 18th, 2006, 01:57 PM
can you post your code for us, so we can help you.

quick answer: onSelectedIndexChanged Event for data grid

this.textBox1.Text = this.dataGrid1.SelectedItem.Text.ToString();


should work, but its impossible for any of us to know that unless you post your code
hth,
mcm

karthik_balus
March 20th, 2006, 01:12 AM
This is not working... They are not accepting the text values in datagrid selected item... I tried the same code....

I exactly need the select the item from datagrid which i need to place it in a textbox later...

I have the same coding which u gave me...

Please help me out in this...