Hi Developers,
I have done the generate hyperlink column dynamically and working fine as get Column Names from database.
However suppose someone change the naming convention on database sp it will not work or throw error.
So now am need to bind the respective Column Values Dynamically.am using the following C# code
XmlNodeList DataClassWiseInventoryDetails = doc.GetElementsByTagName("GetClassWiseInventoryDetails");
DataTable dtDetails = Dynamic.ConvertXmlNodeListToDataTable(DataClassWiseInventoryDetails);
foreach (DataRow drDetails in dtDetails.Rows)
{
// Current Output
drDetails[dtDetails.Columns[0].ColumnName.ToString()] = "<a style='color:blue' href='#' onclick='return ViewBasicDetails("" + drDetails["Vehicle_Type"] + "," + drDetails["CLASS_ID"] + "," + 2 + "");' title='Click To View'>" + drDetails["Vehicle_Type"] + "</a>";
drDetails[dtDetails.Columns[1].ColumnName.ToString()] = "<a style='color:blue' href='#' onclick='return ViewBasicDetails("" + drDetails["Total_Tags"] + "," + drDetails["CLASS_ID"] + "," + 2 + "");' title='Click To View'>" + drDetails["Total_Tags"] + "</a>";
// Expected Output
drDetails[dtDetails.Columns[0].ColumnName.ToString()] = "<a style='color:blue' href='#' onclick='return ViewBasicDetails("" + BindColumnNameValueDynamically + "," + BindColumnNameValueDynamically + "," + 6 + "");' title='Click To View'>" + BindColumnNameValueDynamically + "</a>";
drDetails[dtDetails.Columns[1].ColumnName.ToString()] = "<a style='color:blue' href='#' onclick='return ViewBasicDetails("" + BindColumnNameValueDynamically + "," + BindColumnNameValueDynamically + "," + 1 + "");' title='Click To View'>" + BindColumnNameValueDynamically + "</a>";
}
If anyone of you know how to done this task, kindly suggest me to complete this.
Thanks and Regards,
Paul.S