I use WebHierarchicalDataGrid, there are several bands (several levels of data).
For each band the RowEditingTemplate is specified.
I see that final page markup contains "rendered" template for each parent row. In other words, if a dropdown element is specified as template for child band, it will be rendered for each parent rows.
It is very insufficient, because the dropdown has a lot of values, and if my grid has a lot of rows, the size of page of will be excessively increased.
UltraWebGrid renders template only one time.
Maybe there is any option that forces to render template only once?
Hi AlexanderZh,
Currently, this is the expected behavior. It is because each child grid derives from the WebDataGrid, so has its own options, and thus sends down a template for itself. It would need to be fixed by us for this to work. I would submit a feature request.
regards,David Young
Hi, David!
Thank you for answer.
Could you explain me one else thing regarding WebHierarchicalDataGrid.
Using UltraWebGrid I've implemented following scenario:
User clicks on the button, the new row is added to the grid on the client side(not postbacks), actually it is empty row, and 'edit template' is opened for that newly added row.User enters values and clicks 'OK'. After that the postback is invoked.
Is it possible to do the same for WebHierarchicalDataGrid?
Could new row be added without postback?
for now the code below lead to immediate postback
grid.get_rows().add(new Array(1, 'text'));
Please explain, for now I am getting rid of old UltraWebGrid and there are a lot of things that I have to remake.
Alexander
HI Alexander,
There is no default behavior in the WDG or WHDG to have a button that adds a row. We only have the RowAdding behavior. You call grid.get_rows().add(valArray), where grid is a ContainerGrid object (not the WHDG object). This could be done on a button click. On Editing Core, you will need Batch Updating on. Batch Updating was added in 11.2. Then an empty row would be added to the grid without posting back right away. Then the user could enter edit mode on the new row to set the values. You could commit with another button somewhere.
Thank you,
I've tried, it works.
Could you aslo say what event I should subscribe for to get changes on the server side, something like 'UpdateRowBatch' for UltraWebGrid.
And is there any client side method that can invoke postback,
I used to invoke postback using following method, but now I think it is obsolete
igtbl_doPostBack(gridName);
Hello Alexander,
I am following up to see if the information provided has resolved this matter.
Please let me know if I may be of further assistance with this matter.
Thank you for your patience. After some further research I found that you can use $find over $get. With this you can pass in the ClientID and get or set the value, please see the following forum post for more information concerning this matter.
http://forums.infragistics.com/forums/t/24684.aspx
Other than this alteration there doesn’t appear to be any other alternate solutions to getting and setting the value for items in the RowEditTemplate.
Please let me know if you have any questions concerning this matter.
Seeing as how Dave has been able to answer your questions pertaining to entering a RowEditTemplate for a newly added row and having a delayed postback through batch updating I will look further into an alternate way of having a custom user control as a RowEditTemplate. I will give you a progress update by the end of the day Tuesday.
Thank you very much for help.
Could you share your thoughts on one more thing:
I want to use UserControl as RowEditingTemplate.
All works fine, the control is shown correctly but there is a problem with data binding, I've done it as shown below, but I don't like it, maybe you could suggest something better:
<ig:RowEditingTemplate > <ClientBindings> <ig:RowEditingClientBinding ColumnKey="SubRuleId" ControlID="subRuleTemplate" GetValueJavaScript="$get({ClientID}+'_txtSubRuleId'). SetValueJavaScript="$get({ClientID}+'_txtSubRuleId').value = {value};" /></ClientBindings><Template> <controls:SubRuleTempate runat="server" ID="subRuleTemplate"></controls:SubRuleTempate> </Template></ig:RowEditingTemplate>
SubRuleTemplate - it is UserControl. it has asp:TextBox with id = txtSubRuleId
I dont like the way I am getting to the edit controls located on UserControl:
$get({ClientID}+'_txtSubRuleId')
Hi,There is no UpdateRowBatch event in the WDG. You'll need to handle RowUpdating, RowAdding, or RowDeleting off of the editing core behavior on the server. To commit changes, you can call grid.get_behaviors().get_editingCore().commit(). Be sure the grid is the container grid of interest, not the WHDG.
-Dave