We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

Get Updated grid values

Thread ID:

Created:

Updated:

Platform:

Replies:

89707 Sep 3,2009 07:18 AM UTC Sep 16,2009 12:54 PM UTC ASP.NET Web Forms (Classic) 3
loading
Tags: GridGroupingControl
Harshad Teli
Asked On September 3, 2009 07:18 AM UTC

Hi
I have four checkbox column in grid, i am binding grid on SelectedIndexChanged event of dropdownlist. after binding grid i change some values of check boxes which are in now i want this updated values of grid in SelectedIndexChanged event of dropdownlist so that i can save those values ...
How can i achive this ?

Harshad Teli
Replied On September 3, 2009 07:21 AM UTC

i want all grid details with updated records....
currently i am using following code but it brings me grid data with old values

UserRight objUserRight;
List lstUserFunctions = new List();

if (grdFunctionList.Table.Records.Count > 0)
{
foreach (Syncfusion.Grouping.Record obj in grdFunctionList.Table.Records)
{
objUserRight = new UserRight();
objUserRight.FunctionGroup = Convert.ToString(obj.GetValue("FunctionGroup"));
objUserRight.FunctionName = Convert.ToString(obj.GetValue("FunctionName"));
objUserRight.SystemFunctionID = Convert.ToInt32(obj.GetValue("SystemFunctionID"));
objUserRight.SystemFunctionGroupID = Convert.ToInt32(obj.GetValue("SystemFunctionGroupID"));
objUserRight.Access = Convert.ToBoolean(obj.GetValue("Access"));
objUserRight.Create = Convert.ToBoolean(obj.GetValue("Create"));
objUserRight.Edit = Convert.ToBoolean(obj.GetValue("Edit"));
objUserRight.View = Convert.ToBoolean(obj.GetValue("View"));
objUserRight.Delete = Convert.ToBoolean(obj.GetValue("Delete"));
lstUserFunctions.Add(objUserRight);
}

}

Harshad Teli
Replied On September 7, 2009 06:53 AM UTC

hi,


incase new record is added to the dropdown list within the Syncfusion grid i am unable to get the current record of the dropdown as at this point grid has 0 records for these reason the grid controls(drop down) is not found and its value is b=null

how do i get the selected value of the dropdown ..

Melba Winshia [Syncfusion]
Replied On September 16, 2009 12:54 PM UTC

Hi Harshad,

Thank you for your interest in Syncfusion Products.

You can get the updated grid values and the selected value of dropdownlist in GridRowEditUpdateLink onclick event of GridGroupingControl. Please refer below code snippet to achieve this:

protected void GridRowEditUpdateLink1_OnClick(object sender, GridRowEditUpdateEventArgs e)
{
Label1.Text = "";
switch (e.CommandLinkType)
{
case "Update":
DropDownList dropdown = null;
foreach (TableRow row in this.GridGroupingControl1.TopLevelTable.Rows)
{
if (row is GridRow)
{
GridRow gridRow = row as GridRow;
if (gridRow.Record != null)
{
Record record = gridRow.Record;
foreach (GridCell gridCell in gridRow.Cells)
{
if (gridCell.ColumnDescriptor.HeaderText == "Reference Data 1")
{
foreach (Control cntl in gridCell.Controls[0].Controls)
{
if (cntl is DropDownList)
{
dropdown = cntl as DropDownList;
GridCellTemplated grid = (GridCellTemplated)dropdown.Parent.Parent;
//To retrieve the updated values
//Label1.Text += gridRow.Record.GetValue("Id") + "--" + gridRow.Record.GetValue("Name") + "--" + dropdown.SelectedValue + "
";
}
}
}
}
}
}
}
e.CurrentRecord.SetValue("Collections", dropdown.SelectedValue.ToString());
break;
}
}



Please refer the sample in the below link which illustrates the above:

http://files.syncfusion.com/support/GGC.Web/7.3.0.20/89707_Grid/main.htm

Please try this and let me know if this helps you out.

Thanks,
Melba



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

Warning Icon You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.Close Icon

;