This is a migrated thread and some comments may be shown as answers.

Can we attach server side events for NestedViewTemplate controls ?

2 Answers 31 Views
Grid
This is a migrated thread and some comments may be shown as answers.
Ram
Top achievements
Rank 1
Ram asked on 10 Apr 2012, 11:07 AM
Hi,

I am having "NestedViewTemplate" with in the "MasterTableView".   ( RadGrid )

In NestedViewTemplate, Some readonly controls, and three editable textboxes.
In MasterTableView, i have some GridBoundColumn and a GridButtonColumn.

My requirement is i need to update my source list, when your users enters text in nestedviewtemplate textbox.  Currently when ever i am clicking the enter key after giving some text in nestedviewtemplate textbox, its calling radgrid itemcommand event, since mastertable view contain a button column.

Can i pass any command argument from the textbox ( inside the nestedview template ) to differentiate with masterview button click  (or) can we attach any server side event for the texboxes inside the nestedview template. ?


2 Answers, 1 is accepted

Sort by
0
Princy
Top achievements
Rank 1
answered on 10 Apr 2012, 11:37 AM
Hello Ram,

You can attach server side events to the TextBox in ItemCreated event as shown below.
C#:
protected void RadGrid1_ItemCreated(object sender, GridItemEventArgs e)
{
  if (e.Item is GridNestedViewItem)
  {
    GridNestedViewItem item = (GridNestedViewItem)e.Item;
    TextBox txt = (TextBox)item.FindControl("TextBox1");
    txt.TextChanged += new EventHandler(txt_TextChanged);
  }
}
 void txt_TextChanged(object sender, EventArgs e)
{
 }

Thanks,
Princy.
0
Ram
Top achievements
Rank 1
answered on 10 Apr 2012, 11:56 AM
Thanks Princy, I hope this solution enough for now... :-)
Tags
Grid
Asked by
Ram
Top achievements
Rank 1
Answers by
Princy
Top achievements
Rank 1
Ram
Top achievements
Rank 1
Share this question
or