O
Ole
Hello everybody.
Problem:
I want to use a row in the datagrid, that is the first row.
This row should be allways blank, so that the user can enter
a value in _one_ column. This value should be used as the
filter criteria for that row.
example:
| header01 | header02 | header03 |
----------------------------------
| | | | <- this row should consist of textinputfields
----------------------------------
| cat01 | data | data |
----------------------------------
| cat01 | data | data |
----------------------------------
| cat02 | data | data |
----------------------------------
if now the user enters the following:
| header01 | header02 | header03 |
----------------------------------
| "cat01" | | | <- user enters filter criteria and presses
---------------------------------- enter
| cat01 | data | data |
----------------------------------
| cat01 | data | data |
----------------------------------
| cat02 | data | data |
----------------------------------
The datagrid now should be set up with the filter criteria for the column
in that the user entered the value. Meaning concretely, that the
first row should only show the values of "group" cat01.
How is this possible ?
I tried to insert a datarow at top of the datatable that is the datasource for
the datagrid. Then i set up this very row to be editable all the time.
How can i trap the event triggered when the user presses enter in the text box ?
code looks something like this : ( all code is pseudonyms )
(asp:datagrid id="_dg_main" runat="server"
OnItemUpdateCommand="_dg_main_UpdateCommand")
...
(/asp:datagrid)
( replaced tags with parens, google terms )
In the codebehind file i wrote this:
....
public void _dg_main_UpdateCommand ( Object sender, ... e ) {
DataTable dt = get_datasource ( );
filtercrit = e.Item.Cells .. ( get cell content ) .. ;
DataView view = new DataView ( dt );
view.filter = filtercrit ( or something like this )
}
again, how may i map the pressing of the enter key within a text box
to firing the event ?
Thanks in advance for any hints and excuse my bad english.
Greetings Ole VM
Problem:
I want to use a row in the datagrid, that is the first row.
This row should be allways blank, so that the user can enter
a value in _one_ column. This value should be used as the
filter criteria for that row.
example:
| header01 | header02 | header03 |
----------------------------------
| | | | <- this row should consist of textinputfields
----------------------------------
| cat01 | data | data |
----------------------------------
| cat01 | data | data |
----------------------------------
| cat02 | data | data |
----------------------------------
if now the user enters the following:
| header01 | header02 | header03 |
----------------------------------
| "cat01" | | | <- user enters filter criteria and presses
---------------------------------- enter
| cat01 | data | data |
----------------------------------
| cat01 | data | data |
----------------------------------
| cat02 | data | data |
----------------------------------
The datagrid now should be set up with the filter criteria for the column
in that the user entered the value. Meaning concretely, that the
first row should only show the values of "group" cat01.
How is this possible ?
I tried to insert a datarow at top of the datatable that is the datasource for
the datagrid. Then i set up this very row to be editable all the time.
How can i trap the event triggered when the user presses enter in the text box ?
code looks something like this : ( all code is pseudonyms )
(asp:datagrid id="_dg_main" runat="server"
OnItemUpdateCommand="_dg_main_UpdateCommand")
...
(/asp:datagrid)
( replaced tags with parens, google terms )
In the codebehind file i wrote this:
....
public void _dg_main_UpdateCommand ( Object sender, ... e ) {
DataTable dt = get_datasource ( );
filtercrit = e.Item.Cells .. ( get cell content ) .. ;
DataView view = new DataView ( dt );
view.filter = filtercrit ( or something like this )
}
again, how may i map the pressing of the enter key within a text box
to firing the event ?
Thanks in advance for any hints and excuse my bad english.
Greetings Ole VM