Microsoft.NET 2.0 Question:
Download Questions PDF

Consider a datagrid in windows application. Here item, rate, qty, amount field are there. When user enters rate and qty, amount should be automatically calculated. When enter key is pressed, the cursor should go from item to rate and then qty and then amount. But amount should be automatically calculated. In Grid when button is clicked, then and then only new row should be created and another button is clicked, row should be removed.Thus give me the solution?

Answer:

A custumised datagridview class has to be written this .class has to inherit the datagridview class.ProcessDialogKey & ProcessDataGridViewKey functions of datagridview class has to be overidden to change the behaviour of tab and enter key.this class is avaible at msdn web site.To make changes to amount column automatically CellValueChanged of datagridview can be called.To make insert and delete operations button type columns can be added and grid.rows.add , grid.rows.remove methods can be called o insert and delete row.

Download Microsoft.NET 2.0 Interview Questions And Answers PDF

Previous QuestionNext Question
How to prepare parametrized (with more than one parameters) crystal report.pls tell me the code procedure, if any body can?How to create multiple inheritance inc#, with example?