I'd like to set certain grid properties generically. Meaning, I have a
method located in an independent class, pass in the particular grid and
have certain properties set. The problem is that I'm not sure how to
get the grid with those set properties back to the calling class. For
example:
DataGridOperation.cs:
public void BindDataGridTableSyle(DataGrid myGrid)
{
myGrid.TableStyles.Clear();
myGrid.TableStyles.Add(gridTableStyle);
}
Form1.cs:
DataGridOperation dgo = new DataGridOperation();
dgo.BindDataGridTableStyle(DataGrid1);
DataGrid1.DataSource = SomeDataTable;
The problem is the properties set in the above method are not coming
through in the grid. Do I need to return myGrid from the method? How
does that work because I'll then have DataGrid1 plus some other method.
Thanks,
Brett