Hi,
Iam using Infragistics 13.1.
GridRecordItem must be used instead of UltraGridCell in 13.1.
Please let me know how to set AllowEditing for GridRecordItem.
Earlier code - UltraGridCell cellRename = e.Row.Cells.FromKey(sRename);
cellRename.AllowEditing = AllowEditing.Yes;
Expecting your response asap. Its urgent.
Thanks in advance.
Hello,
1) If there is editing behavior set on the grid then you can access the column settings of the editing behavior and change it as follows:
WebDataGrid1.Behaviors.EditingCore.Behaviors.CellEditing.ColumnSettings["Number"].ReadOnly = false;
2) If editing on the grid has not been configured you can add it programmatically as follows:
this.WebDataGrid1.Behaviors.CreateBehavior();this.WebDataGrid1.Behaviors.EditingCore.Behaviors.CreateBehavior();
// and then add different settings for each column of the grid
EditingColumnSetting settingColumn1 = new EditingColumnSetting();settingColumn1.ColumnKey = "Number";settingColumn1.ReadOnly = false;
EditingColumnSetting settingColumn2 = new EditingColumnSetting();settingColumn2.ColumnKey = "Date";settingColumn2.ReadOnly = true;
this.WebDataGrid1.Behaviors.EditingCore.Behaviors.CellEditing.ColumnSettings.Add(settingColumn1);this.WebDataGrid1.Behaviors.EditingCore.Behaviors.CellEditing.ColumnSettings.Add(settingColumn2);
Please refer for more details to http://help.infragistics.com/Help/Doc/ASPNET/2013.1/CLR4.0/html/WebDataGrid_Setting_Column_Settings_for_a_Behavior.html
I hope this helps. If you have further questions on the issue, please let me know, I will be glad to help.
Wonderful!!
Thanks very much for the detailed explanation.
I need one more explanation.
Please let me know how to set TargetURL for GridRecordItem.Earlier code - UltraGridCell cellRename = e.Row.Cells.FromKey(sRename); cellRename.TargetURL = BuildRenameTargetURL( cellOwner.Value.ToString(), cellReadOnly.Value.ToString(), cellBOId.Value.ToString(), sNameBeforeLink, cellDescription.Value.ToString(), Page is System.Web.UI.Page, Utilities.GetLocale(Request), Server);
Awaiting your response.
Hi Hristo,
Sample attachment seems to be wrong.
Could you please send me the sample in C# code behind where in
1. hyperlink is created for a column 2. Check box is created for a column
Awaiting your reply.
Hello Jeevitha,
Could you explain do you mean by "the sample is wrong" ?
Let me note that:
1) If you want to set TargetURL for GridRecordItem
- There is no such property in the current WebDataGrid control in comparison to the classic UltraWebGrid. You can use ItemTemplate for the cells in that column and place link inside for example - this is demonstrated in the attached sample.
2) Checkbox is created for a column
You have three ways to implement that:
1) Use item template as shown for the links
2) Using BoundCheckBoxField
3) Use UnboundCheckBoxField
You can see the modified sample attached to see how an UnboundCheckBoxField is added.Also you can refer for more details to http://help.infragistics.com/Help/Doc/ASPNET/2013.2/CLR4.0/html/WebDataGrid_Columns.html
I hope this helps.
I didnt mean that.
Iam looking for some full sample which is done in C# code behind.
I found just the InstantiateIn sample in the below link.
http://ko.infragistics.com/community/forums/p/60079/305164.aspx#305164
It would be really great if i could get complete sample using the InstantiateIn Itemtemplate as given in the link.
Please revert at the earliest.
Thanks.
I have modified the sample so that the template columns are added programmatically in the code behind as you wish.
Please review it and let me know if it meets your requirements.
It was Perfect!!! Thanks a lot Hristo for the committed support.
Hello Jeevtiha,
I am glad this helped. If you have any further questions on the issue, please let me know.
Your suggestion really helped.
Thanks for the quick reply. Appreciate!
I'm just following up to see if you need any further assistance with this issue. If so please let me know.
When using the LinkButton control as in my example you should be able to call the function as a parameter in the .Add method as follows:
LinkButton link = new LinkButton();link.Text = "Link to Google";link.Attributes.Add("href", GetLink());
container.Controls.Add(link);
So if the GetLink() function returns some string as "http://google.com" then the control will be rendered with the following html:
<a href="http://google.com">Link to Google</a>
Please try it on your side and let me know if it works for your scenario.
Need your suggestion here.
In Ultrawebgrid's InitializeRow, a function was mapped to the Ultragridcell's TargetUrl property in earlier version of Infragistics(7.3).
Below is the code snippet.
UltraGridCell cellCopy = e.Row.Cells.FromKey(sCopy);
cellCopy.TargetURL = Controller.BuildCopyTargetURL(cellOwner.Value.ToString(),cellReadOnly.Value.ToString(),cellBOId.Value.ToString(),cellName.Value.ToString(),cellDescription.Value.ToString(),Page is System.Web.UI.Page,Utilities.GetLocale(Request), Server);
Now that there is no TargetUrl property in webdatagrid, Would be really helpful if you could let me know how i can achieve this in Webdatagrid's InitializeRow.
Thanks!