After call RetrieveStructure(), the value of column's anme is changed to value of column's caption

1 reply. Last post: June 14, 2011 11:18 PM by Yudi
Tags :
  • (None)
  • New Discussion
  • New Question
  • New Product Feedback
Mang LuMember

I would like to use contextmenu to reset defalute gird view,  I first call

WebGrid1.ClientAction.RefreshAll() in the WebGrid1_InitializePostBack, then call

WebGrid1.RetrieveStructure() method in the event handler WebGrid1_PrepareDataBinding, so far, everything is ok. but after I save the default view and close the page, thw reopen the page, I find by debugging that the WebGrid1.Roottable.columns' name is change to its Caption. it means the value of name and caption are same as caption's value.

The code slip is as follow:

 

public partial class OwGrid1 : System.Web.UI.UserControl

{

static bool Iscalled = false;

 

protected void WebGrid1_InitializePostBack(object sender, ISNet.WebUI.WebGrid.PostbackEventArgs e)

{

if (e.Action == ISNet.WebUI.WebGrid.PostBackAction.Custom)

{

switch (Request["OwGridMenu"])

{

case "OwDelete":

WebGrid1.ClientAction.RefreshAll();

Iscalled =
true; break; case "OwSave": this.SaveCustomView(this.WebGrid1); break;

}

}

}

 

protected void WebGrid1_PrepareDataBinding(object sender, ISNet.WebUI.WebGrid.DataSourceEventArgs e)

{

if (Iscalled)

{

WebGrid1.RetrieveStructure();

Iscalled =
false;

}

}

All times are GMT -5. The time now is 10:21 PM.
Previous Next