GeekInterview.com
Series: Subject: Topic:

DataGrid Interview Questions

Showing Questions 1 - 14 of 14 Questions
Sort by: 
 | 

How to refresh the data in datagrid automatically

Asked By: Prajakta Deshpande | Asked On: Mar 13th, 2006

Answered by: Anilkumar Lella on: May 20th, 2011

Using cache you can automatically refresh the datagrid data

Answered by: sivabalanp on: Aug 10th, 2010

Bind the datagrid by calling "datagridname.databind() "

What is the advantage of datagridview instead of using datagrid

Asked By: tuhina | Asked On: May 15th, 2007

Answered by: Sanjida123 on: Jul 29th, 2010

DataGrid is the implementation of framework 1.1. It doesn't provide support for complex implementation such as image loading, combobox use in the datagrid control.

DataGridView is the implementation of framework 2.0 onwards. It is the overcome of 1.1 drawback.

Answered by: neerajagg18 on: Jul 30th, 2009

1. In datagrid you have to do lots of task for sorting, paging. In gridview sorting, paging is much easier and you can do with only 2-3 line of coding.

2. DataGrid control doesn't take full advantage of data source components. GridView fully support data source components.

Hi, I was asked this in an interview I want to add buttons,images,etc to the footer of a datagrid at runtime. How would I achieve this?

Asked By: Yatin | Asked On: Sep 25th, 2006

Answered by: vaishalibharat on: Mar 21st, 2010

At design time, we can add button in footer template of the grid. <asp:TemplateField> .... <FooterTemplate> <asp:Label ID="lblTotalInvoiceAmount" runat="server" Text...

Answered by: albu77 on: Jun 1st, 2009

As they ask you to do it at run time, you need to add the controls to the control collection of the cell of the footer row of the gridView.
Button myBtn = new Button();

gvTest.FooterRow.Cells[1].Controls.Add(myBtn);

Play caution where the dynamic addition is done if you want it to persist.

How to add controls in datagrid

Asked By: kbs.shohaib | Asked On: May 16th, 2008

Answered by: nymishore on: Nov 30th, 2009

Take template column and and Insert the Controls what ever you want to add the dataGrid, and find those control in Grid Itembound/ItemCommand.

Answered by: Saravan987 on: Nov 29th, 2009

If you want to add the controls on the grid, you can use item template.

Example:

<asp:TemplateField>
<ItemTemplate>
<asp:CheckBox ID="Chk" runat="server" />
</ItemTemplate>
</asp:TemplateField>

What is the main differences between cts , cls

Asked By: knreddy221 | Asked On: Nov 8th, 2006

Answered by: albu77 on: Jun 1st, 2009

CTS is the specification of the types which are with .net defined in the plateform and not anymore langage dependant (since .net is language agnostic).

CLS is the published description of what should be done and followed for anyone whishing to design a .net compatible language .

Answered by: sbehera02 on: Jan 2nd, 2007

CTS-Common Type SystemIn order to communicate between two language,CLR  has CTC,for example In C# it can an "Int" and in VB it "LONG",so interfacing betwwen is a difficult task,so in dot net...

Data grid serial number

Asked By: sekaranpg | Asked On: Oct 25th, 2007

How to add serial number in the data grid dynamically, windows application, using c#

Answered by: nt57323 on: Mar 25th, 2009

I am providing the solution in ASP. Just convert this as you like.I have tried this one at my end and its working fine.Just take one Template field as Serialno. in Datagrid. Below is the code in H...

Answered by: msg2mano on: Nov 28th, 2007

//try this coding ---this may help u i thingusing System;using System.Collections.Generic;using System.ComponentModel;using System.Data;using System.Drawing;using System.Text;using System.Windows.Form...

Hi, how to sort the data in gatagrid ? When we use databound event of datagrid,,,, I want to display the data using controls.... For an example, ...

Asked By: Ravi Majji | Asked On: Jun 5th, 2006

Answered by: nt57323 on: Mar 24th, 2009

Use the Itemtemplate column type and drag the controls whichever you want. Bind the control with the  database coloumn name (ex: eval("fldticketid")).

What are the events used in the datagrid?

Asked By: haa_johnson1 | Asked On: Oct 3rd, 2007

Answered by: Vaastu on: Sep 29th, 2008

Cancel Command
Delete Command
Edit Command
Update Command
Item Command

Answered by: Dipali Shah on: Sep 4th, 2008

ItemCommand

ItemDataBound

EditCommand

UpdateCommand

CancelCommand

Load

init

DataBinding

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.

Asked By: Interview Candidate | Asked On: Jun 29th, 2005

Answered by: Dipali Shah on: Sep 4th, 2008

Yes, you can add rows one by one at runtime. for that you have to maintain DataTable and its ViewState. So after pageload data is not removed from datatable.For display purpose you have to bind that ...

Answered by: devendra on: Sep 5th, 2007

Example
dim da as new sqldataadapter("select...",conn)
dim ds as new dataset
da.fill(ds,xyz)
dim dr as datarow
dr=ds.tables(0).rows.newrow
with dr
.items(0)=textbox1.text
.items(1)=textbox2.text
.items(2)=textbox3.text
ds.tables(0).addrow(dr)

datagrid1.datasource=ds.tables(0)

How mts component link in .Aspx pages

Asked By: Priyanka | Asked On: Mar 30th, 2006

Answered by: sujeetkumartsr on: Aug 5th, 2008

A basic MTS architecture is made up of: The MTS Executive (mtxex.dll) The Factory Wrappers and Context Wrappers for each component The MTS Server Component MTS clients Auxiliary systems like: COM runt...

Answered by: Raja on: Jul 28th, 2006

Its Good Q:

Export data grid content to excel file

Asked By: sekaranpg | Asked On: Oct 25th, 2007

How to get the content of datagrid into excel format?I want to use this feature in windows application and c#, visual studio .Net 2003

Answered by: kundankum on: Feb 25th, 2008

for windows application u use excel object to create excel file

Answered by: sekaranpg on: Oct 27th, 2007

I think, this code is for web application. Is there any code for windows application

How to add datetime control in ormal datagrid server control

Asked By: pramodbura | Asked On: Mar 10th, 2006

Answered by: sho on: Apr 8th, 2007

Hi,
You can use template column to add controls like label, textbox etc.
The same way you can add datetime control also.

Answered by: pradip manna on: Mar 29th, 2006

cvv

Hi, 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,...

Asked By: aspnet | Asked On: Jun 5th, 2006

Answered by: PavanKumar on: Oct 26th, 2006

Hi,In order to sort the data in the datagrid apply rowFilters. . . This can be done by using either a DataView or a DataTable. The data that we get from the database is stored in the tables and datavi...

Answered by: Makesh. R on: Jul 25th, 2006

Hi Friends,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 str...

Ads

Connect

twitter fb Linkedin GPlus RSS

Ads

Interview Question

 Ask Interview Question?

 

Latest Questions

Ads

Interview & Career Tips

Get invaluable Interview and Career Tips delivered directly to your inbox. Get your news alert set up today, Once you confirm your Email subscription, you will be able to download Job Inteview Questions Ebook . Please contact me if you there is any issue with the download.