3
Answers

Auto Generate in DropDownList

Photo of narasiman man

narasiman man

13y
2.2k
1
auto generate in drop down list example E0001 etc..,

Answers (3)

0
Photo of Administrator
Admin 2.3k 1.3m 22y
But if You use sorting or filtering in DataGrid use DataView instead of DataTable. The simple solution (not tested, when it works): myDataGrid.DefaultView[myRow].Row[myField] or more complicated - create Your own property in object inherited from DataGrid: public DataView GridView { get { try { return (DataView)(this.ListManager.List); } catch { return null; } } } and use it: myDataGrid.GridView[myRow].Row[myField]
0
Photo of Administrator
Admin 2.3k 1.3m 22y
Los_Calibra First get the Row number of the selected row: int gridRow = dataGrid1.CurrentCell.RowNumber Next get the DateSource : DataTable dt = ((DataSet)dataGrid1.DataSource).Tables["My_Table"]; Now get the value: dt.Rows[gridRow]["Column_Name"] Hope this Helps
0
Photo of Administrator
Admin 2.3k 1.3m 22y
When You select only one row (standard in DataGrid) it's quite good. Next - you may create inherited DataGrid and override select methods (with "new" keyword; usual overriding is impossible). Now I'm trying to do this. I use four methods: public new void Select(int row){ ... } public new void UnSelect(int row){ ... } public new bool IsSelected(int row){ ... } protected new void ResetSelection(){ ... } It works, but not always - it's necessary to find another methods/properties to override I think. You may create your own event OnSelection etc. in these methods (or create your own delegate with another parameters): public event EventHandler OnSelection; and use it: if(OnSelection!=null) OnSelection(this);
0
Photo of Administrator
Admin 2.3k 1.3m 22y
At this point I have this problem: How can I get the data object behind the currently selected row of a DataGrid WinControl. How can I retrive the value of a specific field what corespond to that selected row - for example value for IDField who does'nt have a reprezentative column in that DataGrid. A C# example will be good!
0
Photo of Administrator
Admin 2.3k 1.3m 22y
CurrentCellChanged CurrentCell.RowNumber