How can we catch the values of controls which are placed in the datagrid

Showing Answers 1 - 5 of 5 Answers

vishal sharma

  • Apr 3rd, 2006
 

hi dear

you can catch the control contained in the datagrid by using the datagrid's item collection.

this way:

e.g you put a textbox in the datagrid in the firstrow, firstcolum

then try this

//first create a object of the textbox

TextBox Txt1=new TextBox();

Txt1=(TextBox)e.item.cell[0].control[0];

try this if done then ok otherwise you can contact me.

happy coding

  Was this answer useful?  Yes

shubhoh

  • Apr 24th, 2006
 

anser is correct but dont do new to the textbox bec u r instantiating it with the textbox in the grid

  Was this answer useful?  Yes

mahesh joshi

  • Jun 13th, 2006
 

The above code is correct

  Was this answer useful?  Yes

Jagtar

  • Nov 2nd, 2006
 

Use Item command to bind all the controls which are placed on different columns of a datagrid. when we will click on any control then it will fire a bubble event. Itemcommand will write the code in javascript for each control, any action is happed that code will execute and pass to common bubble event handler and item command code will be execute and page will be posted back to server. These events can also be handled on client side.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.

 

Related Answered Questions

 

Related Open Questions