从 devexpress gridview1 的回调中绑定 Devexpress girdview 2
我在一个页面中有两个 Devexpress gridview。
我尝试从 devexpress gridview1 的自定义回调方法将数据绑定到 devexpress gridview2..
好吧,devepress gridview 2 上没有填充任何结果.. 它是银行...
代码如图所示
ASPxGridView1_CustomCallback(object sender, ASPxGridViewCustomCallbackEventArgs e)
{
DataTable dt_getdata = CommonBL.GetUserDefinedresult("select * from Accounts where ID='tr=009'");
if(dt_getdata!=null)
{
ASPxGridView2.DataSource = dt_getdata;
ASPxGridView2.DataBind();}}
调试时没有发现错误...为什么会这样? ?请提出解决方案!
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, ASPxGridViewCustomCallbackEventArgs 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!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
出现此问题的原因是回调响应包含有关启动此回调的控件的信息。即,如果 ASPxGridView2 不是 ASPxGridView1 的一部分,则此代码不会产生任何效果,因为有关 ASPxGridView 的信息不会传递到客户端。一种可能的解决方案是向 ASPxGridView2 发送回调,并将该控件绑定到其 CustomCallback 事件处理程序中的数据。另请参阅如何在单独的 ASPxGridView 中显示详细信息示例。
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