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
Can you provide me with some clarification on how you are preparing this filter expression.Is the goal to apply some filter directly on the data source or are you applying multiple filters on the grid columns and want to apply all in a single postback ?
Please do not hesitate to contact me if you need further assistance.
I have the following requirements with the Web Data Grid.Can you please help me in giving the solutinons for them.
1)How can I highlight a one of the columns of the web data grid?I need to highlight the one of the columns of the web data grid with the color say suppose yellow.
2)I have a button in my page called reload grid which will refresh the grid by calling a function in cs file which uses
this
.WDGTP.RequestFullAsyncRender();to refresh the grid.
when i do this it is not setting the cursor of the scroll bar to the first row of the grid.
I want the cursor to point to the first row of the grid after refresh it should not retain its previous position.
3)I want value in the cell to be shown in one line. I dont want it to come to the second/3rd/4th line if the length of the value is bigger than the width of the cell.If it is bigger than the width of the cell I want to show only the value that can fit in the column width and remaining value can be seen once the user resize the cell width with the mouse cursor made available to him.
To clarify the first question I asked in this forum:
say my grid is having student data with columns student first name,lastname,marks in subject1,marks in subject2,marks in subject3,roll number etc. This data I am getting from storeprocedure using below code
<
asp:SqlDataSource ID="SQLDSTP" runat="server" OnSelected="SQLDSTP_Selected" ConnectionString="<%$ ConnectionStrings:xxxxConnectionString %>"
SelectCommand="SP_SCREEN_xxxx"
SelectCommandType="StoredProcedure">
<SelectParameters>
<asp:ControlParameter ControlID="txtFilterExpression" DefaultValue="1=1" Name
="ParamFilterExpression" PropertyName="Value" Type="String" />
</SelectParameters>
</asp:SqlDataSource>
txtFilterExpression is my filterexpression which is a text box.
in the application I will be providing the option for the user to filter the grid.
I will give few check boxes and drop downs for the users to select the filters.
say suppose user want to see the students of roll numbers from 1 to 10.so user will check the roll number check box and select the value min=1 max=10 then click on the button add filter.
now the text box txtFilterExpression will have value 1<=roll number<=10 which is a parameter to the sqldatasource.
I want the grid to refresh once the user selects like this kind of filters and clicks on apply filter button.
I have done this with the ultra web grid I have prepared the filter expression and kept the value in the text box and supplied this value to the sql data source and then did a refresh of the gird.everything i did it on client side I dont want a post back to happen here.
I want the same to achieve this with the web data grid.
Thanks
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 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
Thank you so much for your support Petar,
It is working well now...I am happy..
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 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.