Hi
I am using Infragistics version 8.2 , My Problem is when page is loading i am not able to Bind data in to ultraweb grid i had given two events like
Ultrawebgrid_init anf Ultrawedgrid_initializedatasource
protected void UltraWebGrid1_Init(object sender, EventArgs e) { UltraWebGrid1.InitializeDataSource += new Infragistics.WebUI.UltraWebGrid.InitializeDataSourceEventHandler(UltraWebGrid1_InitializeDataSource); } protected void UltraWebGrid1_InitializeDataSource(object sender, Infragistics.WebUI.UltraWebGrid.UltraGridEventArgs e) { BindDataNew();// This is my binding function }
I am calling above BindDataNew(); Under button click also so the problem is i am not able to binding the grid when page is loading but when i am clicking the button the grid is loading with data
Based on the grid data i am doing other calculation these values are coming properly when page load also and i had seen my dataset in debugging mode the dataset is showing values but grid is coming with meassage like "No Data Display" but when i am clicking the button the grid is loading properly
Please help me....
Thanks
Sivaprasad
Hi SreeRam,
Can you please tell me how to write in Page_Shown (I didn't get what is Page_Shown event is it like Render event)
please sample code for this
Regards
Now we changed our requirement means we are not binding grid when page is loading, we are binding the grid when we user clicks on Generate button, so for this scenario i am not using InitializeDataSource event and i am using one method which is querying to database and getting data and constructing dataset and i am giving relationsfor datatables, i am calling this method on my button click, based on the dataset result i am displaying number of rows count of My first band.The count is coming properly but in grid it is binding it is giving a message like No data to display, but when i am clicking the button again the grid is binding. i think every time same method is executing and dataset also returning same data when binding only some problem occurs.here i am not able to found why grid is not loading firsttime.
After clicking the button first time it is giving message(No data to display) but if i perform postback through another control it is loading the grid in my page i have a drop down which had Autopostback = 'true'
1)User clicks the generate button grid is giving a message No Data to display but number of rows count is coming properly
2)At this stage if i perporm postback through dropdown my grid is loading with data and rows count is also same
In my bindgrid method the code is like this
{
UltraWebGrid1.DataBind();
}
else
Cleardata();//I am clearing text of number of rows count label
And in my page load event i am using this code:
if(!Ispostback)
if(ViewState["dsValue"] != null)
Dataset ds = (Dataset)ViewState["dsValue"] ;
UltraWebGrid1.DataSource = ds;
Above code is executing when post is occuring by button (or) by dropdown, so the grid is loading with data but first time click of button it is not loading, suggest me if there is any wrong logic in my code.
It's a bit hard to tell. Like Vince said, can you confirm through a breakpoint in InitializeDataSource that the databinding code is correctly being run on the initial request to the page? Can you set various breakpoints in the method you have and grid events, so that you see if some piece of code is not running at all (or runs at a not expected time of the page lifecycle)?
Also, can you try hooking the InitializeDataSource event through the designer? I see that it is currently being hooked in the UltraWebGrid.Init event handler which I am not sure executes at all and Visual Studio actually using OnInit of the page for event hooking instead.
hi
Currently my problem is when i click Generate button to load data i am calling Getdata (). in this method we are constructing new logical datatables and combining these based on relations
In My dataset i had three tables
dsVal.Relations.Add("lead", dsVal.Tables["BrokerCommission"].Columns["brokeragentid"], dsVal.Tables["Leads"].Columns["agentid"]);
My grid containing three bands when i clicking the button firstname Grid is not loading , but rows count i am showing in one label (this value is coming properly but in grid it is showing No Data To Display. but when i am clicking second time the grid is loading and the rows count is same, only the first time binding is not showing,
Bsed on user selection i am querying to database and getting data and constructiong tables, so when the user selected different one and clicking the button the grid is showing with data, Only First time it is not showing.
Please Help me...