Interviewer And Interviewee Guide

Professional DataGrid (Grid view) Interview Questions & Answers:

1. In DataGrid, is it possible to add rows one by one at runtime. That means after entering data in one row next row will be added?

Yes, for this you have to use datatable and after inserting the first row in datatable u have to bind that datatable to the grid and next time , first u have to add the row in datatable and next bind it to datagrid. keep on doing.
u have to maintain the datatable state.

2. Why can not I add an entry via the grid for a table containing a CLOB column?

In older versions of TOAD, the grid is limited to adding/modifying CLOB's for existing records. This should be working in TOAD 7.6. Note, however, that since TOAD does not support Unicode databases, that there are often errors when viewing CLOB data in the data grids for databases with Unicode character sets.

3. How do I copy a whole row or multiple rows of data?

To copy one row of data, put your cursor in a cell in the grid and press Ctrl+Insert. This will copy the row and its column headers to the clipboard. To copy multiple rows of data, right-click in the grid and choose "Allow multiselect". Use Shift-Click to select multiple adjacent rows, or use Ctrl+Click to select individual, non-adjacent rows. Press Ctrl+C. This will copy all of the rows and their column headers to the clipboard. To copy a single cell's data, turn off "Allow multiselect". Click on the cell you want to copy and press Ctrl+C.

The following table gives details of what happens with the various copy keys and multi-select options.
Multi-Select OFF Multi-Select ON
EDIT COPY CTRL+C CTRL+INS EDIT COPY CTRL+C CTRL+INS
One Cell Highlighted Cell only Cell only Row plus headings Cell only Cell Only Row plus headings
Many Cells(rows) highlighted N/A N/A N/A All highlighted rows plus headings All highlighted rows plus headings All highlighted rows plus headings

4. How can I view the Chinese and Japanese character sets through Toad?

Reset NLS_LANG on your Client machine to AMERICAN_AMERICA.JA16SJIS to view Japanese and AMERICAN_AMERICA.ZHT16BIG5 to view Chinese. Then change the font script for each language by right clicking on the data and choosing Grid Options | Data Grids - Visual | Fonts | Grid and choose Arial Unicode MS as the Font. This changes the script to Japanese for Japanese characters or to ChineseBig5 for Chinese.

5. How to add DateTime Control in ormal DataGrid Server Control?

cvv

using template column we can very well add date time control as child contorl

6. How to refresh the data in datagrid automatically?

For refreshing data in data grid control we can use chasing technique

7. How to sort the data in Datagrid ? when we use DataBound event of Datagrid, I want to display te data using controls....
For an example,
If i click a button, which is outside of the datagrid, entire data should be shown. 1st column in TextBoxs. second column in Drop down List Boxs..
How to bind the data in Dropdownlist,which is in DataGrid at run time?
Row1 Row2 Row3 Row4 ----------------- This is the record in datagrid...

When we click button (Bottom of the DataGrid), This Record should be shown...
Row1 in TextBox,,, Row2 in TextBox, Row3 in DropDownlistbox, Row4 in TextBox...
How to do this one?
Which event we should use?

Sorting in DataGrid.Using the SortCommand Event in the datagrid u can sort the value in datagrid.For Example.Dim con as new oledb.oledbconnection("connectionstring")con.open()Dim sql as stringsql="query"Dim DataAdapter as new oledb.oledbdataadapter(sql,con)dim ds as new datasetdataadapter.fill(ds)Private Sub DGMain_SortCommand(ByVal source As Object, ByVal e As System.Web.UI.WebControls.DataGridSortCommandEventArgs) Handles DGMain.SortCommand Dim datasort As DataView datasort = LocalLibrary.GetDataSet(sql).Tables(0).DefaultView datasort.Sort = e.SortExpression DGMain.DataSource = datasort DGMain.DataBind() End SubBind the data in Datagrid at runtime ?Use ItemDataBound Event in datagrid.Private Sub DGMain_ItemDataBound(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.DataGridItemEventArgs) Handles DGMain.ItemDataBound If e.Item.ItemIndex > -1 Then Dim lblClose As dropdownlist lblClose = CType(e.Item.FindControl("lblClose"), dropdownlist) If Not lblClose Is Nothing Then lblclose.items.add("dropdownassignvalue")lblclose.items("dropdownindex").value="assigned value" End If End If End Sub

8. What is asp.net?

ASP.NET is the latest version of Microsoft's Active Server Pages technology (ASP).

ASP.NET is a part of the Microsoft .NET framework, and a powerful tool for creating dynamic and interactive web pages

9. How do you customize the column content inside the datagrid?

If you want to customize the content of a column, make the column a template column. Template columns work like item templates in the DataList or Repeater control, except that you are defining the layout of a column rather than a row.

10. How do you apply specific formatting to the data inside the cells?

You cannot specify formatting for columns generated when the grid's AutoGenerateColumns property is set to true, only for bound or template columns. To format, set the column's DataFormatString property to a string-formatting expression suitable for the data type of the data you are formatting.

Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.