Top 45 Datagrid Interview Questions
Q1. 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 confined to including/modifying CLOB's for existing data. This should be running in TOAD 7.@Note, however, that seeing that TOAD does no longer guide Unicode databases, that there are regularly errors when viewing CLOB information within the facts grids for databases with Unicode man or woman units.
Q2. What Is The Difference Between Windows Forms And Web Forms Datagrid Control?
Web Forms have the collection of pages that carry out the spherical experience for the processing at the server. Whereas, Windows Forms doesn’t perform that properly at the processing the front.
Web Forms DataGrid control uses much less integrated functionality, whereas, Windows Forms uses more integrated functionality.
Web Forms DataGrid control doesn’t aid exact grasp records structure, whereas, Windows Forms helps the statistics structure.
Web Forms DataGrid manage helps the two way binding and the automation is being carried out for the facts, whereas, Windows Forms doesn’t offer two manner binding and manual code want to be written.
Web Forms permit users to edit handiest one row at a time and doesn’t have aid for sorting and no event handles, whereas, Windows Forms offer all that.
Q3. Why Can Not I Set A Style In My Xls Saveas Exports Of Datagrid Data?
Try upgrading to the present day release of TOAD, as we've acquired an up to date XLS component. If you are still experiencing the problem, you could try this: FORMAT ? CELLS ? NUMBER TAB ? Alternate to Currency, Percentage, etc.
Q4. Write A Program That Adds Two Columns Binded With The Same Properties And Having Column Headings Using Xaml?
Columns may be delivered of their personal manner through making two exceptional columns and adding them using the feature of Column.Add().
The order of the columns isn't decided by means of the order in which they are proven or stored. To listing the order use of DisplayIndex property is used.
To upload the columns which can be binded with each other first there's a want to create the data and add the records to the objects collection.
XAML is used to instantiate and initialize the two columns and produces the equal end result with the in-constructed function as regular language.
<DataGrid Height="50"
HorizontalAlignment="Right"
Margin="7,9,0,0"
Name="dataGrid"
VerticalAlignment="Top"
Width="100" >
<DataGrid.Columns>
<DataGridTextColumn
Binding="Binding Path=name"
Header="Name">
</DataGridTextColumn>
<DataGridTextColumn
Binding="Binding Path=age
Header="Age">
</DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
Q5. How Does The Binding Work In Datagrid?
Binding works on the basis of specifying an object and a property to the object that wishes to be binded.
The property of the object is saved and retrieved of the records this is worried in binding.
The collection of records is being saved in a Data Grid and it is being supplied by using the usage of CollectionView item that determines all the gadgets in the collection for use as binding.
CollectionView object points usually to the cutting-edge object that is being bound to a single item and includes single belongings.
The CollectionView is used as a base elegance and it may be used to navigate the object’s contemporary function in the course of the gathering.
The DataContext is being set to one of the gadgets with the paths already described that is being pointed to the binding object assigned to a column.
Q6. How Can I See Timestamp And Interval Data?
TOAD 7.Five and up can show TIMESTAMP and INTERVAL facts in its statistics grids in case you are using a 9.0.1 or higher Oracle consumer. TOAD 9.0.1 helps TIMESTAMP and INTERVAL facts in its "run as script" feature. TOAD variations 7.Four and former do no longer help TIMESTAMP and INTERVAL data due to a drawback in their records layer.
To see timestamp/durations inside the "datatype" drop down in the Create/Alter Table window, and within the "Add Column" window, visit alternatives ? Datatypes, and make certain "Include Timestamp/Interval Types" is checked.
Q7. What Are The Different Types Of Columns That Exist In Datagrid?
The specific column kinds utilized in DataGrid are as follows:
BoundColumn: this type is used to display the sector in a information source. The field includes an item inside the form of text. This is the default column kind in DataGrid control.
ButtonColumn: this kind is used to display the column that consists of editing commands used within the column.
HyperLinkColumn: this kind displays the content of object in the column as a hyperlink. The content can be inside the shape of a text or it can have an association with different fields.
TemplateColumn: this kind displays the item according the template and it also allow the advent of custom controls for the templates.
Q8. Why Is The Update Strategy Not Preferred To Be Used In Datagrid Control?
The replace method is inefficient to provide the updates to the database for each of the grid row.
The updates despatched aren't sufficient to expose the changes which might be being made each minute/seconds.
Manual good judgment desires to be up to date to check for the adjustments that has taken region among the controls in a specific row in grid.
Comparisons are tough to make between one of a kind datasets and databases that entails a round journey.
No checking of the database take area to see the updations and modifications made in it after some time.
Q9. Why Can Not I Add A New Record By Hitting The Down Arrow Key In The Data Tab?
Please upgrade your reproduction of TOAD to as a minimum version 7.Four.0.@This functionality has been restored.
Q10. Write A Program To Manually Define The Columns In .Netgrid?
The columns can be manually defined by using the usage of the property AutoGenerateColumns and exchange that property to False.
The columns need to be described in the columns collection and in the data grid location.
The software so as to make the columns is:
DataGridCheckBoxColumn // to outline the boolean values
DataGridComboBoxColumn // to define the enumerable values
DataGridHyperlinkColumn // to outline the Uri values
DataGridTemplateColumn // to outline the types of information for the mobile template
DataGridTextColumn // to outline text values
<DataGrid ItemsSource="Binding_Products" AutoGenerateColumns="False" >
<DataGrid.Columns>
<DataGridTemplateColumn Header="Image" Width="SizeToCells" IsReadOnly="True">
<DataGridTemplateColumn.CellTemplate>
<DataTemplate>
<Image Source="Binding_Image" />
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
</DataGrid.Columns>
</DataGrid>
Q11. Difference Between Dataset And Datareader.?
Dataset:
DataSet object can contain more than one rowsets from the same records supply in addition to from the relationships between them.
Dataset is a disconnected architecture
Dataset can persist facts.
Datareader:
DataReader gives ahead-most effective and read-most effective get right of entry to to information.
Datareader is hooked up architecture
Datareader cannot persist facts.
Q12. How Can I View The Chinese And Japanese Character Sets Through Toad?
Reset NLS_LANG in your Client system to AMERICAN_AMERICA.JA16SJIS to view Japanese and AMERICAN_AMERICA.ZHT16BIG5 to view Chinese. Then trade the font script for each language through proper clicking at the data and deciding on Grid and choose Arial Unicode MS as the Font. This changes the script to Japanese for Japanese characters or to ChineseBig5 for Chinese.
Q13. Explain My String Data Is All Coming Out As Question Marks?
We have located that this takes place whilst the database man or woman set is WE8ISO8859P1, and the Oracle purchaser is nine.2.0.@This is an Oracle worm, and upgrading your customer to nine.2.0.4 or higher should resolve the trouble. In every other case, please generate a TOAD Support Bundle from the Help menu and let us realize what you're seeing.
Q14. Write A Program To Show Different Selection Modes In Data Grid?
The facts grid consists of the choice modes that may be configured and custom designed in step with the requirements.
It includes the selection modes assets as SelectionMode and SelectionUnit.
The choice mode of the data grid may be set to either single or extended. This way it defines the selection of 1 or more gadgets.
SelectionUnit is used to define the scope of 1 selection unit in regarlds to the cellular row with the aid of the usage of the statistics as Cell, CellAndRowHeader and FullRow.
The application is as follows:
<DataGrid ItemsSource="Binding_Products"
SelectionMode="Extended" SelectionUnit="Cell" />
Q15. How Is It Possible To Edit The Data In Datagrid?
DataGrid presents a way to edit the facts and set the houses to create an excellent user interface.
DataGrid provides a way to create an software that gives interactivity by way of using the set or unset of the strategies like CanUserAddRows, CanUserDeleteRows, CanUserReorderColumns, etc.
To edit look for the houses that begins with CAN and change it in keeping with the necessities.
Adding or enhancing of a row or records outcomes the collection of the Items that is assigned to the ItemsSource.
Q16. In Datagrid, Is It Possible To Add Rows One By One At Runtime. That Me After Entering Data In One Row Next Row Will Be Added?
Yes, for this you have to use datatable and after putting the first row in datatable You must bind that datatable to the grid and next time , first you have to add the row in datatable and subsequent bind it to datagrid. Keep on doing. You ought to keep the datatable kingdom.
Q17. What Is The Purpose Of External Ienumerables Used In Datagrid?
External IEnumerables are used to collect the gathering of Items which are supplied with the DataGrid.
The data that is being displayed is typically having external resources like database connection so DataGrid uses an outside series item.
Before series any records it's miles critical to set the ItemsSource belongings and an item type is created to hold the facts.
The example of maintaining the item kind is proven below:
public class Person
public string call set; get;
public int age set; get;
public bool member set; get;
Collection of those gadgets needs to be created for the list of them:
List<Person> myList = new List<Person>();
myList.Add(new Person() name="hiya",age=30,member=actual);
myList.Add(new Person() name="yello",age=25,member=false);
myList.Add(new Person() call="mello",age=15,member=proper);
To display the collection the DataGrid object is used like:
dataGrid.ItemsSource=makeList;
Q18. What Tag Do You Use To Add A Hyperlink Column To The Datagrid?
<asp:HyperLinkColumn>
Q19. How To Add Datetime Control In Ormal Datagrid Server Control?
Cvv using template column we will very well add date time manipulate as infant control.
Q20. How Can I See The Data In Nested Tables?
TOAD 7.Five and up can show nested table records in popups from the records grids in case you are the usage of an eight.Zero or better Oracle patron. The nested desk statistics will seem within the grid mobile as "(DATASET)". Right-click on over this mobile and select "Popup editor". TOAD nine.Zero.1 now supports nested desk facts in its "run as script" function. TOAD versions 7.Four and former do not support nested desk information because of a challenge of their statistics layer.
Q21. What Are The Ways In Which The Functionalities Can Be Added To Datagrid Control Data Source?
DataGrid manipulate allows the consumer to modify and control the statistics with out including the new ones. To add the capability following matters need to be done:
Add a new report within the records supply for the grid and assign an ID to the file.
Put a placeholder values in the homes place for columns and make a column such that it can’t be null.
Rebind the DataGrid manipulate to the supply via which the change can be accomplished.
Determine the region wherein the document will appear at the grid.
Update the file that allows you to be computerized when the user clicks on it or updates a hyperlink or a brand new report is introduced.
Q22. What Are The Ways That Properties Can Be Shown In Datagrid?
DataGrid suggests the residences inside the shape of columns and every column save a few value.
DataGrid want two columns and each of them is sure to have one assets every and this is also exceptional from one another.
After developing the two columns with the properties the binding must be achieved of these columns to display the records.
The ways are being proven as:
DataGridTextColumn col1 = new DataGridTextColumn();
col1.Binding = new Binding("name");
DataGridTextColumn col2 =
new DataGridTextColumn();
col2.Binding = new Binding("age");
dataGrid1.Columns.Add(col1);
dataGrid1.Columns.Add(col2);
Q23. Ado.Internet Code Showing Dataset Storing Multiple Tables?
Declare and initialize database connection object with appropriate connection string.
Create a DataAdapter and a Dataset item.
Using fill approach of the DataAdapter object, load the data into the Dataset Object.
Change the adapter's SELECT command.
Create the EmpDetail desk.
Add both tables to a unmarried dataset.
Display the statistics the use of statistics binding function of controls like Datagrid or Datalist.
Dim m_adptEmp As SqlDataAdapter:
Private Sub Page_Load(ByVal sender As System.Object, _ByValeAsSystem.EventArgs)HandlesMyBase.Load<BR> DimEmpConnAsNewSqlConnection_<BR> ("server=(neighborhood);database=Employees;Trusted_Connection=sure")
m_adptEmp = New SqlDataAdapter("choose * from Emp", EmpConn)
Dim dsEmp As New DataSet
m_adptEmp.Fill(dsEmp, "Emp")
adptEmp.SelectCommand.CommandText = "SELECT * FROM EmpDetail"
Dim EmpDetail As New DataTable("EmpDetail")
adptDB.Fill(EmpDetail)
dsBoth.Tables.Add(Emp)
dsBoth.Tables.Add(EmpDetail)
DataGrid1.DataSource = dsEmp.Tables("Emp").DefaultView
DataGrid1.DataBind()
End Sub
Q24. Write A Program To Display The Use Of Multiple Columns In Datagrid?
The DataGrid this is used contains the supply to have more than one columns to comprise the records in an smooth and ordered way.
Every column within the a couple of columns is having one-of-a-kind belongings of the objects and having series of objects.
The objects are named in line with the homes given from get/set homes and the general public statistics subject in this example can’t be created.
The application that shows the advent of more than one columns in DataGrid is as follows:
public struct MyData
public string call set; get;
public int age set; get;
dataGrid1.Items.Add(
new MyData()name="John",age=25);
dataGrid1.Items.Add(
new MyData()name = "Jill",age = 29 );
Q25. What Is The Purpose Of Using Datagrid Control?
The DataGrid manage is used to show the fields of the desk. It is basically associated with the statistics source that is present in the column of a table.
DataGrid affords the get admission to to the rows that lets in the manage to be taken to the record in the facts source.
DataGrid control presents numerous functions like modifying, selection, deleting, paging and sorting.
DataGrid control lets in the person to put in writing the enter to convey the output on the net the front. It can contain the executable scripts or SQL statements.
DataGrid manipulate makes use of the validation server manipulate to validate the statistics rows and columns of the table.
Q26. How Do You Apply Specific Formatting To The Data Inside The Cells?
You can not specify formatting for columns generated while the grid's AutoGenerateColumns assets is set to actual, best for certain or template columns. To layout, set the column's DataFormatString assets to a string-formatting expression suitable for the data type of the statistics you're formatting.
Q27. Explain The Procedure To Display An Editable Drop-down List?
To show an editable drop-down listing it calls for:
Template column that is present in the Grid and an object of ItemTemplate that encompass controls like records-certain.
Use of Label controls that produces the contemporary price of the field gift inside the report.
Adding of the drop down listing takes location by using using the item EditItemTemplate. This object provides a column in the template and the assets may be customized according to the requirement.
DropDownList manage may be taken from the EditItemTemplate property editor and modifications being made into it to represent it on the net the front.
The template column of the drop down listing can be delivered to HTML view.
Q28. Difference Between Datagrid, Datalist And Repeater.?
Similarities:
They are all ASP.NET data Web controls.
They have not unusual properties like:
DataSource Property
DataBind Method
ItemDataBound
ItemCreated
When the DataSource Property of a Datagrid is assigned to a DataSet then every DataRow present inside the DataRow Collection of DataTable is assigned to a corresponding DataGridItem.
Difference:
Datagrid:
The HTML code generated has an HTML TABLE detail created for the unique DataRow and is a tabular representation with Columns and Rows. Datagrid has a in-built guide for Sort, Filter and paging the Data.
Datalist:
An Array of Rows and based totally at the Template Selected and the RepeatColumn Property value The wide variety DataSource statistics that seem in keeping with HTML
Repeater Control:
The Datarecords to be displayed depend on the Templates special and the only HTML generated consequently. Repeater does not have in-constructed aid for Sort, Filter and paging the Data.
Q29. What Are The Tasks That Are Involved After The Drop-down List Gets Created?
Drop down lists are easy to add on a template column after which introduced in addition in HTML view.
There are two duties concerned after populating the drop-down list and they're as follows:
Populate the list this is being utilized by the internet utility or any software consistent with the requirement.
Pre-pick the precise object to be introduced at the list of drop-down that is simply being created.
The drop-down list receives created with the sphere already being stuffed and the class being pre-decided on from earlier than that has to be displayed in the starting.
Q30. What Is Dataset Object? Explain The Various Objects In Dataset.?
The DataSet object is a disconnected garage.
It is used for manipulation of relational information.
The DataSet is filled with facts from the store
We fill it with facts fetched from the statistics shop. Once the work is done with the dataset, connection is reestablished and the changes are reflected lower back into the store.
Dataset has a collection of Tables which has DataTable collection which in addition has DataRow DataColumn gadgets collections.
It also has collections for the number one keys, constraints, and default values known as as constraint collection.
A DefaultView item for every desk is used to create a DataView item based on the desk, in order that the data can be searched, filtered or otherwise manipulated while showing the records.
Q31. How To Refresh The Data In Datagrid Automatically?
For fresh statistics in statistics grid manage we are able to use chasing method.
Q32. How Do You Check Whether The Row Data Has Been Changed?
The definitive way to decide whether or not a row has been dirtied is to handle the changed occasion for the controls in a row. For instance, if your grid row incorporates a TextBox control, you can reply to the control�s TextChanged event. Similarly, for test packing containers, you could reply to a Checked Changed event. In the handler for those activities, you preserve a listing of the rows to be up to date. Generally, the best strategy is to track the primary keys of the affected rows. For example, you may maintain an ArrayList item that contains the number one keys of the rows to update.
Q33. How Do I Copy A Whole Row Or Multiple Rows Of Data?
To copy one row of records, positioned your cursor in a cellular within the grid and press Ctrl+Insert. This will reproduction the row and its column headers to the clipboard. To replica a couple of rows of statistics, proper-click on within the grid and choose "Allow multiselect". Use Shift-Click to select a couple of adjacent rows, or use Ctrl+Click to select character, non-adjacent rows. Press Ctrl+C. This will copy all the rows and their column headers to the clipboard. To reproduction a single cell's statistics, turn off "Allow multiselect". Click on the cellular you want to duplicate and press Ctrl+C.
The following desk offers info of what happens with the diverse reproduction keys and multi-pick out options.
Multi-Select OFF Multi-Select ON
EDIT COPY CTRL+C CTRL+INS EDIT COPY CTRL+C CTRL+INS
One Cell Highlighted Cell best Cell handiest Row plus headings Cell handiest 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
Q34. Write A Program To Do Column Sorting, Reordering And Resizing?
The information grid presents the functions at the column which can be sorted, reordered and resized consistent with the requirements.
The columns can be enabled and disabled with the aid of the usage of the column and row residences within the program.
The properties used on this are as follows:
CanUserReorderColumns // this allows or disables the re-ordering of the column
CanUserResizeColumns // this allows or disables the resizing of the column
CanUserResizeRows // this enables or disables the resizing of the row
CanUserSortColumns // this permits or disables the sorting of the row
The software is shown as:
<DataGrid ItemsSource="Binding_Products"
CanUserReorderColumns="True" CanUserResizeColumns="True"
CanUserResizeRows="False" CanUserSortColumns="True"/>
Q35. What Is The Oci Buffer Array Size Option For In The View - Options - Oracle - General Section?
After a SELECT query is carried out, we must retrieve the rows from the Oracle server on your PC. We do not retrieve the rows unexpectedly, nor can we retrieve them separately (unless there is a LONG or LOB column involved). We retrieve the rows in blocks. The range of rows retrieved in each block is the wide variety of rows you specify with "OCI Array Buffer Size".
TOAD defaults to twenty-five due to the fact SQL*Plus defaults to two@In my opinion, an ideal placing is extra like 500 or 10@Here is why: If your dataset has 1,000 rows, and your OCI Array Buffer length is ready to 25, then TOAD has to make 40 (it's a thousand / 25) round journeys throughout the community to retrieve all the rows. So you could straight away see why 500 or one thousand is better. The handiest downside to a better putting of OCI Array Buffer Size is that TOAD need to allocate reminiscence to maintain that many rows previous to each fetch. If that many rows are actually fetched, there's no loss. On the alternative hand, if now not that many rows are retrieved, then we allocated a few memory that isn't going to be released until the cursor is freed. Luckily, that is a trivial amout of reminiscence, in the grand scheme of things.
Q36. How Do You Display An Editable Drop-down List?
Displaying a drop-down listing requires a template column inside the grid. Typically, the ItemTemplate contains a control such as a data-sure Label manage to show the present day fee of a field inside the record. You then upload a drop-down list to the EditItemTemplate.
In Visual Studio, you could upload a template column in the Property builder for the grid, and then use trendy template editing to dispose of the default TextBox manage from the EditItemTemplate and drag a DropDownList control into it as an alternative. Alternatively, you can add the template column in HTML view.
After you have created the template column with the drop-down list in it, there are two obligations. The first is to populate the listing. The second is to preselect the precise object inside the list � as an example, if a book�s genre is ready to �fiction,� whilst the drop-down listing displays, you often need �fiction� to be preselected.
Q37. How Can I See Nested Object Data?
TOAD 7.Five and up can display nested object kind information in popups from the records grids if you are the use of an 8.0 or better Oracle customer. Right-click on on the cellular that have to contain the records and pick out "Popup editor". TOAD nine.0.1 now helps nested item information in its "run as script" function. TOAD versions 7.Four and former do not help nested object facts due to a challenge of their data layer.
Q38. Write A Program To Control The Column Width, Height And Alignment Of Datagrid?
DataGrid manipulate has the manipulate over the rows and columns sizes that fits the height and width of the grid.
AutoGenerateColumns assets must be False to control the column characteristics and it doesn’t allow the column to generate routinely.
The column width may be created the usage of the style element for a particular column. It also can set the width of the detail.
The property may be set like:
<asp:BoundColumn DataField="title" SortExpression="title"
HeaderText="Title">
<ItemStyle Width="100px"></ItemStyle>
</asp:BoundColumn>
Q39. How Can The Appearance Be Controlled In Datagrid?
The appearance can be managed by the usage of the attributes and adding them using the programming.
The tags that may be used are <td> and <tr> tags, that allows the rendering by way of having the control at the browser and the attributes which can be used in this.
Attributes may be used inside the event handler for the OnItemCreated or OnItemDataBound occasion.
The characteristic if need to be delivered then a TableCell items want to, be created that represents the cell in DataGrid.
The DataGridItemEventArgs object is passed to the occasion handler to be used with the TableCell item and use of AttributeCollection.Add technique permit the addition of attributes in the tags.
Q40. How Do You Hide The Columns?
One way to have columns seem dynamically is to create them at layout time, after which to hide or show them as needed. You can try this with the aid of placing a columnï's Visible belongings.
Q41. How Do I Change The Grid Popup Editor Font?
Another one from the listing. Herald asked > I modified the font for the DATA Grids, so I ought to observe Unicode. Now I see the chosen font inside the datagrid, however if I open the popup editor it nevertheless offers the vintage font. Is it viable to alternate this font also, I did not locate it inside the alternatives, or may want to you're making the grid popup editor font similar to the data grid font.
After a whole lot looking, Brad provided the subsequent apparent LOL solution :
*Go to View → Toad Options → Editor → Behavior.
*In the Languages phase, pick out "Plain Text" from the dropdown and click on the Edit ... Button subsequent to the dropdown.
*Go to the Highlighting tab and click the "custom font" button.
*Choose your font and OK your way out.
Q42. What Is The Difference Between The System.Internet.Ui.Webcontrols.Datagrid And And System.Home windows.Forms.Datagrid?
The Web UI control does no longer inherently guide grasp-element records systems. As with different Web server controls, it does no longer aid -way statistics binding. If you want to replace statistics, you have to write code to do that your self. You can simplest edit one row at a time. It does no longer inherently aid sorting, although it raises occasions you may take care of on the way to type the grid contents. You can bind the Web Forms DataGrid to any object that supports the IEnumerable interface.
The Web Forms DataGrid control supports paging. It is simple to customise the appearance and format of the Web Forms DataGrid control compared to the Windows Forms one.
Q43. What Is A Datagrid Or Grid View?
The DataGrid Web server control is a effective tool for showing data from a data source. It is easy to use; you can show editable records in a expert-looking grid by means of setting just a few houses. At the equal time, the grid has a complicated object model that offers you with wonderful flexibility in the way you show the facts.
Q44. What Is The Procedure Followed To Add Attributes In <tr> Tag?
To upload the attribute to <tr> tag fist DataGridItem item is being intitialized.
DataGridItem represents the row inside the DataGrid manage and it facilitates in adding the characteristic to the tag.
The DataGridItemEventArgs object is used to get the DataGridItem object that is handed into the occasion handler.
The AttributeCollection.Add method is used for DataGridItem item to add the characteristic to the <tr> tag that stores the gathering of the gathering of the GridItem.
The addition of the attribute to the tag lets in it to be represented inside the internet page or site in step with the necessities.
Q45. How Do You Customize The Column Content Inside The Datagrid?
If you need to customize the content of a column, make the column a template column. Template columns work like object templates inside the DataList or Repeater manage, except that you are defining the format of a column in place of a row.

