This is a migrated thread and some comments may be shown as answers.

GridViewCell Focus and Edit mode

3 Answers 113 Views
GridView
This is a migrated thread and some comments may be shown as answers.
Gayathri
Top achievements
Rank 1
Gayathri asked on 25 Mar 2013, 06:52 AM
Hi


     I am using a radgridview.I have used a combo box inside cell edit template of a gridViewDataColumn.When i Add a new row,this cell has to go to edit mode,i.e. Change to combo box.I have used the following code snippet to set focus and make it to move to edit mode,But it is not happening.Only Focus is set around the cell,but cell has not gone into edit mode which in this case is a combo Box.Kindly give me a solution or a sample code.

 

 

private void _BoxGrid_SelectionChanged(object sender, Telerik.Windows.Controls.SelectionChangeEventArgs e)

 

{

 

 

int lastCount = e.AddedItems.Count - 1;

 

 

 

if (e.AddedItems.Count != 0 && e.AddedItems[0] != null)

 

{

 

 

var s = e.AddedItems[lastCount] as GenerateBoxNumberEntity;

 

 

 

if (s.IsNewFileSet)

 

{

 

_BoxGrid.Columns[6].Focus();

_BoxGrid.BeginEdit();

 

 

}

}

 

}



regards
gayathri

3 Answers, 1 is accepted

Sort by
0
Yoan
Telerik team
answered on 27 Mar 2013, 12:41 PM
Hi Gayathri,

In order to achieve your goal, I can suggest you to check this help article.

I hope this helps.

All the best,
Yoan
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

0
Gayathri
Top achievements
Rank 1
answered on 07 May 2013, 09:18 AM
Hi

   Thank you for your response. This event is not triggered at all in my case.since I am adding a new row using my own customized button. I suppose this event will be triggered only (via the Insert key or the insert row).Can you give me a solution other than triggering this event. Cos,In my case this event doesn get triggered at all.




regards
gayathri
0
Yoan
Telerik team
answered on 10 May 2013, 08:21 AM
Hi Gayathri,

Indeed, you can set the first column to be focused in your Custom Button's Click event. For example: 

private void Button1_Click(object sender, RoutedEventArgs e)
        {
            this.clubsGrid.BeginInsert();
            this.clubsGrid.CurrentColumn = this.clubsGrid.Columns[0];
        }

Kind regards,
Yoan
the Telerik team

Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Tags
GridView
Asked by
Gayathri
Top achievements
Rank 1
Answers by
Yoan
Telerik team
Gayathri
Top achievements
Rank 1
Share this question
or