Hi,
I created a model "model - presenter - view" in windows forms showing me all data from a table BD in ultrawingrid. That is not used a direct datasource. Now I want to apply the UltraGridRowEditTemplate to edit each line of my wingrid. Me.UtilizadorUltraGrid1.DisplayLayout.Bands (0).RowEditTemplate = RowEdit This way I can to associate the two components. However the UltraGridRowEditTemplate is empty. Does not show the fields in the row selected for editing ... Is there any way for me to show the fields automatically, without using a datasource ???
Hello,
When you using UltraGridRowEditTempate, you could use the designer in order to populate it with editor for the corresponding columns:
http://help.infragistics.com/doc/WinForms/2014.2/CLR4.0/?page=WinGridRowEditTemplate_Adding_a_WinGridRowEditTemplate_Dialog_Box_To_WinGrid.html
http://help.infragistics.com/doc/WinForms/2014.2/CLR4.0/?page=WinGridRowEditTemplate_Adding_Buttons_to_WinGridRowEditTemplates_Dialog_Box.html
or to do this programmatically:
http://help.infragistics.com/doc/WinForms/2014.2/CLR4.0/?page=WinGridRowEditTemplate_Creating_a_WinGridRowEditTemplate_Programmatically.html
Please let me know if you have any further questions.
Hi, I have one more question. After opening the template and change the data that need, to do to write to the database sql ?? The event click OK button only records visually, does not alter the database.
Thanks!
I understand, but my probelma is that I have not DataAdapter and Dataset. I need to write to the database by the BindingSource that's associated with the ultrawingrid. I've used UtilizadorBindingSource.EndEdit () .. But this alone does not save the data in the database.
Can help me ?
Thank you for the reply.
The BindingSource component is used to encapsulate your actual data source. It provides sorting, filtering and other capabilities to your data source. The actual data source that you use is assigned to the DataSource property of the BindingSource. The EndEdit method will apply any pending changes to the underlying DataSource. For more information on the BindingSource class:
http://msdn.microsoft.com/en-us/library/system.windows.forms.bindingsource(v=vs.110).aspx
You will need to update the changes from the underlying DataSource to the database. Depending on the technology you use (ADO, LINQ to SQL, etc.) there are different approaches to do this. This is not related to Infragistics, but if you are able to tell me what you use, I will be glad to give you some pointers on how to update your database.
Let me know if you have any additional questions.
Hi
Already analyzed the EndEdit method of BindingSource. I would be very grateful. I am using the ADO.net technology and can not updater database.
Thanks
I am just checking about the progress of this issue. Let me know If you need my further assistance on this issue?
Thank you for using Infragistics Components.
Hi I need to know how to assign a value directly to a cell proxy row edit template. ugcpDataAlt.Text = datetime.now This is because one of the fields is the date of change of registration. However this field is to be automatically changed to the current date at the time of the click ok the row edit template button. Can you help?
RowEditTemplate is “bound” to the current edited row of UltraGrid, so changes of the cells’ values of the corresponding UltraGridRow will affects RowEditTemplate . To change value of UltraGridRow you could use code like:
UltraGrid.ActiveRow.Cells[“Column key or index”].SetValue(newValue, storeIntoUndoStack);
Or
UltraGrid.ActiveRow.Cells[“Column key or index”].Value = newValue;
Thanks.
Hugs.
Infragistics Team wishes you Merry Christmas and a Happy New Year
Thank you for using Infragistics components.