开发者

Bind Devexpress girdview 2 from devexpress gridview1's callback

I have two Devexpress gridview in a page.

I tried binding data to devexpress gridview2 from devexpress gridview1's custom callback method..

well no result is populated on devepress gridview 2.. it's bank...

The Code is as shown

ASPxGridView1_CustomCallback(object sender, ASPxGridViewCustomCa开发者_如何学运维llbackEventArgs e)
{
 DataTable dt_getdata = CommonBL.GetUserDefinedresult("select * from Accounts where ID='tr=009'");
if(dt_getdata!=null)
{
ASPxGridView2.DataSource = dt_getdata;
ASPxGridView2.DataBind();}}

No errors where found while debugging...why is this So?? Please Suggest a solution!


The problem appears because a callback response contains the information about a control which initiated this callback. I.e. if the ASPxGridView2 is not a part of the ASPxGridView1, this code will not have any effect since the information about ASPxGridView is not passed to the client. A possible solution is to send a callback to ASPxGridView2 and bind this control to data in its CustomCallback event handler. Please also refer to the How to show detail information in a separate ASPxGridView example.


Follow the next steps

  1. Do the iteration of the rows and put into gridview2. Make sure that gridview2 is connected/linked with any database, otherwise no data will be retrieved.
  2. Assign the DataSource of gridview1 to gridview2, keeping in mind to do the BindingSource.EndEdit() and Adapter.Update(Dataset.Table1).
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜