Hi,
I am trying to migrate from ultra web grid of 11.1 to web data grid of 11.2.
In my application I was using the below feature of ultra web grid
grid.invokeXmlHttpRequest(grid.eReqType.Refresh, null, "");
to refreshes the grid on client side.
Do we have a similar feature with the web data grid which will refresh the grid on client side..
can someone provide me information on this.
Thanks in advance
Swetha
Hi Swetha,
You can initiate an Ajax callback from the WebDataGrid using the _callbackManager . Here is some sample code for doing that:
var callbackObject = ig_controls.WebDataGrid1._callbackManager.createCallbackObject(); ig_controls.WebDataGrid1._callbackManager.execute(callbackObject);
var callbackObject = ig_controls.WebDataGrid1._callbackManager.createCallbackObject();
ig_controls.WebDataGrid1._callbackManager.execute(callbackObject);
If you want to observe or set the Async mode state and postback URL (among other settings) using:
ig_controls.WebDataGrid1._callbackManager.getAsync();ig_controls.WebDataGrid1._callbackManager.setAsync(true); ig_controls.WebDataGrid1._callbackManager.getURL();ig_controls.WebDataGrid1._callbackManager.setURL(true);
ig_controls.WebDataGrid1._callbackManager.getAsync();ig_controls.WebDataGrid1._callbackManager.setAsync(true);
ig_controls.WebDataGrid1._callbackManager.getURL();ig_controls.WebDataGrid1._callbackManager.setURL(true);
Please let me know if this helps.
Best Regards,
Petar IvanovDeveloper Support EngineerInfragistics, Inc.http://es.infragistics.com/support
Hi Petar,
Thanks for the quick reply and the code you provided me helped alot.
I really appreciate the quick response of you..
Regards
You can use CSS to style your columns by using the CssClass property of each column. Columns' headers also have this property to allow separate styling of header and cells. For example:
<ig:BoundDataField DataFieldName="ProductID" Key="ProductID" CssClass="backGroundColor"><Header Text="ProductID" CssClass="backGroundColor"/>
.backGroundColor{ background-color:Green !important;}
Resetting the position of the scrollbar after postbacks may be achieved by setting the ScrollTop property of the grid to 0:
WebDataGrid1.ScrollTop = 0;
You can set white-space:nowrap in the .tbody.igg_Item>tr>td class in order to ensure that only the text which can be fitted would be visible:
.tbody.igg_Item>tr>td { white-space:nowrap;}
Regarding the async refresh of the grid - when initiating an asynchronous postback using WebDataGrid's callback manager, only the grid itself is refreshed. As far as I can understand you wish to filter your SqlDataSource based on other controls' values and then reflect the resulting data on the grid.
In this case I would suggest that you use an asp UpdatePanel as you would need to refresh the SqlDataSource in addition to the grid.
Please let me know if you have any questions.
Thank you so much for your response.They are working well except the
I have created the aboce CSS class and used as below: < ig:BoundDataField DataFieldName="Local Product Description" Key="Local Product Description" Width="80" CssClass="tbody.igg_Item>tr>td">This didnot helped me.I tried as below as well.< ig:WebDataGrid ID="WDGTP" runat="server" AutoGenerateColumns="False" DataSourceID="SQLDSTP" Height="350px" Width="980px" CellSpacing="1" StyleSetName="Default" OnInitializeRow="WDGTP_InitializeRow" CssClass="tbody.igg_Item>tr>td">This also didnot helped me. Can you please let me know if I am using it correctly or not.If not can you please suggest me its usage.Thanks in advanceSwetha
I have created the aboce CSS class and used as below:
< ig:BoundDataField DataFieldName="Local Product Description" Key="Local Product Description" Width="80" CssClass="tbody.igg_Item>tr>td">This didnot helped me.I tried as below as well.< ig:WebDataGrid ID="WDGTP" runat="server" AutoGenerateColumns="False" DataSourceID="SQLDSTP" Height="350px" Width="980px" CellSpacing="1" StyleSetName="Default" OnInitializeRow="WDGTP_InitializeRow" CssClass="tbody.igg_Item>tr>td">This also didnot helped me. Can you please let me know if I am using it correctly or not.If not can you please suggest me its usage.Thanks in advanceSwetha
<
ig:BoundDataField DataFieldName="Local Product Description" Key="Local Product Description"
Width="80" CssClass="tbody.igg_Item>tr>td">
This didnot helped me.
I tried as below as well.
ig:WebDataGrid ID="WDGTP" runat="server" AutoGenerateColumns="False" DataSourceID="SQLDSTP"
Height="350px" Width="980px" CellSpacing="1" StyleSetName="Default" OnInitializeRow="WDGTP_InitializeRow" CssClass="tbody.igg_Item>tr>td">
This also didnot helped me.
Can you please let me know if I am using it correctly or not.If not can you please suggest me its usage.
I apologise as I did not elaborate this point clearly in my previous post.
The .tbody.igg_Item>tr>td point is applied to all cells in the grid and is located in the dataGrid.css file (in the ig_res/Default folder). When you add this class to your page (or modify the dataGrid.css) you do not need to assign this CSS class to any property of the grid. You may also try adding !important just in case.
Here is a detailed guide illustrating and explaining the various CSS classes used for styling different parts of WebDataGrid:
http://blogs.infragistics.com/blogs/engineering/archive/2010/08/25/webdatagrid-css-styling-guide.aspx
Thank you so much for your support Petar,
It is working well now...I am happy..
Thank you for your reply.
Glad that your issues have been resolved. Please feel free to contact me with any questions.
Best Regards,Petar IvanovDeveloper Support EngineerInfragistics, Inc.http://es.infragistics.com/support