Hi,
I have a RadGrid that is created dynamically in the code-behind file from the Page_Init event stage, so everything is constructed here.
The grid contains several columns of data, and three hyperlink columns on the far right side of the grid. Each has a javascript function assigned to the NavigateUrl property in the ItemDataBound event handler in the code behind page.
I need to capture the onkeypress javascript event when the user tabs past the last column in the row being edited to trigger an ajax postback so the row being added can be processed and added to the grid's underlying datasource, and a new row automatically added to the end of the grid.
I have no problems getting this behavior out of a GridBoundColumn or a GridDropdownColumn by assigning the onkeypress javascript event to the edit controls in those columns, but cannot get it to work with the hyperlink controls.
I had zero luck in getting the GridHyperlinkColumn to capture the Tab key. Pressing the Tab key simply moved the focus from this control to the next control (in this case, the address bar).
So, then I thought I'd use the GridButtonColumn, using a LinkButton as the button type. I got the onkeypress event to fire when pressing the Enter key, but not the Tab key. The other problem I noticed is that if I set the ShowInEditForm property to true, then the buttons do not render for the GridDataItems (rows not being edited), and if I do not set the ShowInEditForm property, they do not render in the row being edited. I cannot figure out how to get the buttons to display in BOTH types of rows.
Is what I am wanting to accomplish even possible? Optimally, I would like to get the GridHyperlinkColumn to work as I describe above, but I cannot figure out how to get the rendered hyperlink to behave as expected.
I have a RadGrid that is created dynamically in the code-behind file from the Page_Init event stage, so everything is constructed here.
The grid contains several columns of data, and three hyperlink columns on the far right side of the grid. Each has a javascript function assigned to the NavigateUrl property in the ItemDataBound event handler in the code behind page.
I need to capture the onkeypress javascript event when the user tabs past the last column in the row being edited to trigger an ajax postback so the row being added can be processed and added to the grid's underlying datasource, and a new row automatically added to the end of the grid.
I have no problems getting this behavior out of a GridBoundColumn or a GridDropdownColumn by assigning the onkeypress javascript event to the edit controls in those columns, but cannot get it to work with the hyperlink controls.
I had zero luck in getting the GridHyperlinkColumn to capture the Tab key. Pressing the Tab key simply moved the focus from this control to the next control (in this case, the address bar).
So, then I thought I'd use the GridButtonColumn, using a LinkButton as the button type. I got the onkeypress event to fire when pressing the Enter key, but not the Tab key. The other problem I noticed is that if I set the ShowInEditForm property to true, then the buttons do not render for the GridDataItems (rows not being edited), and if I do not set the ShowInEditForm property, they do not render in the row being edited. I cannot figure out how to get the buttons to display in BOTH types of rows.
Is what I am wanting to accomplish even possible? Optimally, I would like to get the GridHyperlinkColumn to work as I describe above, but I cannot figure out how to get the rendered hyperlink to behave as expected.