protected
void grdSystemComponents_ItemCreated(object sender, GridItemEventArgs e){
if
(e.Item is GridDataItem && e.Item.IsInEditMode || e.Item is GridFilteringItem)
{
foreach (GridColumn column in e.Item.OwnerTableView.RenderColumns)
{
if ((column is GridBoundColumn) && !((GridBoundColumn)column).ReadOnly)
{
TextBox textBox = null;
if (e.Item is GridDataItem)
{
textBox = ((TextBox)((GridDataItem)e.Item)[column.UniqueName].Controls[0]);
textBox.Style["width"] = "90%";
textBox.Style["height"] = "11px";
textBox.Style["border"] = "0px";
textBox.Style["font-size"] = "11px";
} }
//Each column is assigned UniqueName as ID of respective Column
string headerID = column.HeaderText;
int count = dtHeaderInfo.Rows.Count;
for (int i = 0; i < count; i++)
{
if (headerID == dtHeaderInfo.Rows[i][0].ToString())
column.UniqueName = dtHeaderInfo.Rows[i][0].ToString();
} } } }
Here are my two Issues:
1) Since Grid is set up this way, I have no idea how to calculate Footer Total for each columns. Number of column changes depending on the selected Item on Combo Box.
2) I also need to update Caluculation as user will enter number on textboxes of the Grid. In the grid, there is a column called "Tot Num", as user enter numbers here I need to update other columns on same row, user can change it but can't exceed value of "Tot Num" column. If "Tot Number" is zero, should not allow to enter number.
I need to have database interaction for calculation? How do I go go to accomplish this? Your help is much appreciated.
thansk
Madhu