Can any one help me adding row adding behavior to webdatagrid programatically
Dim RowAdditions As RowAdding = webDataGrid1.Behaviors.EditingCore.Behaviors.CreateBehavior(Of RowAdding)()
is giving me the object null exception
Thanks in Advance
Hello Grasshoper,
Please make sure that you have added the EditingCore behavior before that :
grid.Behaviors.Add(grid.Behaviors.CreateBehavior<Infragistics.Web.UI.GridControls.EditingCore>()); grid.Behaviors.EditingCore.Enabled = true;
//Row Adding grid.Behaviors.EditingCore.Behaviors.Add(grid.Behaviors.EditingCore.Behaviors.CreateBehavior<Infragistics.Web.UI.GridControls.RowAdding>());grid.Behaviors.EditingCore.Behaviors.RowAdding.Enabled = true;
Otherwise you are on a right way to achieve this.
http://help.infragistics.com/NetAdvantage/ASPNET/2010.2?page=WebDataGrid_Adding_a_Behavior_at_Runtime.html
Let me know if you need further assistance .
Hello,
This code does not works with WebHierarchicalDataGrid.
On my asp page I am adding
<
>
</ig:WebHierarchicalDataGrid> And I am creating and populating data tables(used for the datasource) on fly. I need to add add/delete/update functionality on two bands of WebHierarchicalDataGrid.
</ig:WebHierarchicalDataGrid>
And I am creating and populating data tables(used for the datasource) on fly.
I need to add add/delete/update functionality on two bands of WebHierarchicalDataGrid.
Infragistics.Web.UI.DataSourceControls.
(); dvParent.ID =
dvParent.ID =
;
); populateTable(tOrders,
populateTable(tOrders,
); dvParent.DataSource = tOrders; Infragistics.Web.UI.DataSourceControls.
dvParent.DataSource = tOrders;
(); dvChild.ID =
dvChild.ID =
); populateTable(tOrder_details,
populateTable(tOrder_details,
); dvChild.DataSource = tOrder_details;
dvChild.DataSource = tOrder_details;
();
//Adding views to WebHierarchicalDataSource
hdsMain.DataViews.Add(dvParent);
hdsMain.DataViews.Add(dvChild);
drMain =
(); drMain.ParentDataViewID =
drMain.ParentDataViewID =
; drMain.ChildDataViewID =
drMain.ChildDataViewID =
; drMain.ParentColumns =
drMain.ParentColumns =
}; drMain.ChildColumns =
drMain.ChildColumns =
}; hdsMain.DataRelations.Add(drMain);
hdsMain.DataRelations.Add(drMain);
.WebHGrid.DataSource = hdsMain;
.WebHGrid.DataBind();
>());
//Row Adding
.Bottom;
.Single;
Thank you a lot!
Also Itry to find Infragistics control tha will be represent DetailsView.
Is that exist?
Hello Simona,
Infragistics does not have DetailsView equivalent in its tool sets.
There is a forum post demonstrating how UltraWebGrid works with the default ASP Detailts View:
http://forums.infragistics.com/forums/t/11610.aspx
Let us know if you need further assistance regarding this.
Thank you very match, Tsvetelina!
Tsvetelina, please help with date formattind in WebGrid. Did not find any examples in Internet.
11/6/2010 12:00:00 AM - I need to display short date like 11/6/2010. I use
ig:BoundDataField DataFieldName="Date_Received" Key="BoundColumn_2"
DataFormatString="{0:d}" DataType="System.Date" HtmlEncode="False" >
Did not work
<ig:BoundDataField DataFieldName="Date_Received" Key="BoundColumn_2" DataFormatString="{0:MM/dd/yyyy}" DataType="System.Date" HtmlEncode="False" > also did not work. Please advise. Thank you Simona
<ig:BoundDataField DataFieldName="Date_Received" Key="BoundColumn_2"
DataFormatString="{0:MM/dd/yyyy}" DataType="System.Date" HtmlEncode="False" >
also did not work. Please advise.
Thank you
Simona
It looks like you are setting string data to DateTime column.
Please assure that you are setting DateTime value. For example :
<ig:BoundDataField DataFieldName="Date" Key="Date"
DataFormatString="{0:MM/dd/yyyy}" DataType="System.DateTime" >
<Header Text="Date" />
</ig:BoundDataField>
Code behind:
dt.Columns.Add("Date", typeof(DateTime));
DateTime now = new DateTime(2010, 11, 29, 11, 11, 11);
String date = "11/29/2010 11:11:11 AM";
IFormatProvider theCultureInfo = new System.Globalization.CultureInfo("en-GB", true);
DateTime theDateTime = DateTime.ParseExact(date, "MM/dd/yyyy HH:mm:ss tt", theCultureInfo);
for (int i = 0; i < 100; i++)
{
dt.Rows.Add(new object[] { i, "Row " + i.ToString(), theDateTime });
}