Click here to Skip to main content
15,891,431 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: delete confirm in asp.net with vb.net 1.1 Pin
postmaster@programmingknowledge.com6-Sep-06 14:38
postmaster@programmingknowledge.com6-Sep-06 14:38 
QuestionGridView / ObjectDataSource problem [modified] Pin
Robin C6-Sep-06 5:53
Robin C6-Sep-06 5:53 
AnswerRe: GridView / ObjectDataSource problem Pin
minhpc_bk6-Sep-06 20:08
minhpc_bk6-Sep-06 20:08 
GeneralRe: GridView / ObjectDataSource problem Pin
Robin C7-Sep-06 11:12
Robin C7-Sep-06 11:12 
GeneralRe: GridView / ObjectDataSource problem Pin
minhpc_bk7-Sep-06 22:56
minhpc_bk7-Sep-06 22:56 
QuestionInfragistics ultrawebgrid Pin
shivarishxxxx6-Sep-06 4:17
shivarishxxxx6-Sep-06 4:17 
AnswerRe: Infragistics ultrawebgrid Pin
g00fyman6-Sep-06 4:43
g00fyman6-Sep-06 4:43 
GeneralRe: Infragistics ultrawebgrid Pin
shivarishxxxx6-Sep-06 5:05
shivarishxxxx6-Sep-06 5:05 
Hi, Here is the code . And when i debug, the dataset is getting populated.
The error 'Object reference not set to an instance of an object' pops up at
grid1.DisplayLayout.AutoGenerateColumns = true; line in the code.

Am now having the grid in design time..and am giving this also
<%@ Register TagPrefix="igtbl" Namespace="Infragistics.WebUI.UltraWebGrid" Assembly="Infragistics.WebUI.UltraWebgrid.v2">

Please help.



using Infragistics.WebUI.UltraWebGrid;
using System.Data.SqlClient;

namespace A
{
public class sample : System.Web.UI.Page
{

protected Infragistics.WebUI.UltraWebGrid.UltraWebGrid grid1 ;

private void Page_Load(object sender, System.EventArgs e)
{
if (!Page.IsPostBack)
{
LoadContent();
}
}
private void LoadContent()
{
string strConnectionString = "data source=abc" +
"Database=Sample;User Id=a;Password=a;";


SqlConnection cnn;
cnn = new SqlConnection(strConnectionString);
try
{
cnn.Open();
}
catch (Exception ex)
{
throw ex;
}
grid1 = new Infragistics.WebUI.UltraWebGrid.UltraWebGrid();
SqlDataAdapter da;
DataSet ds1;
string s = "select * from a";
ds1 = new DataSet();
da = new SqlDataAdapter (s,cnn);


da.Fill(ds1, "Grid");
grid1.DataSource = ds1;
grid1.DisplayLayout.AutoGenerateColumns = true;
grid1.DataBind();



}
private void grid1_InitializeLayout(object sender,LayoutEventArgs e)
{
grid1.Width = System.Web.UI.WebControls.Unit.Pixel(400);
grid1.Height = System.Web.UI.WebControls.Unit.Pixel(400);

grid1.Bands[0].AllowAdd = Infragistics.WebUI.UltraWebGrid.AllowAddNew.No;
grid1.Bands[0].AllowDelete = Infragistics.WebUI.UltraWebGrid.AllowDelete.No;
grid1.DisplayLayout.AllowSortingDefault = AllowSorting.OnClient;
grid1.DisplayLayout.AllowColSizingDefault = Infragistics.WebUI.UltraWebGrid.AllowSizing.Free;
grid1.DisplayLayout.RowSizingDefault = Infragistics.WebUI.UltraWebGrid.AllowSizing.Free;
grid1.DisplayLayout.RowHeightDefault = System.Web.UI.WebControls.Unit.Pixel(22);
grid1.DisplayLayout.HeaderStyleDefault.Height = System.Web.UI.WebControls.Unit.Pixel(20);

grid1.Columns.FromKey("reportTitle").HeaderText = "Report Title";
grid1.Columns.FromKey("reportTitle").Width = System.Web.UI.WebControls.Unit.Pixel(550);
grid1.Columns.FromKey("reportTitle").AllowUpdate = AllowUpdate.No;

grid1.Columns.FromKey("reportName").HeaderText = "Report Title";
grid1.Columns.FromKey("reportName").Width = System.Web.UI.WebControls.Unit.Pixel(550);
grid1.Columns.FromKey("reportName").AllowUpdate = AllowUpdate.No;

}

#region Web Form Designer generated code
override protected void OnInit(EventArgs e)
{
//
// CODEGEN: This call is required by the ASP.NET Web Form Designer.
//
InitializeComponent();
base.OnInit(e);
}

///
/// Required method for Designer support - do not modify
/// the contents of this method with the code editor.
///

private void InitializeComponent()
{
this.Load += new System.EventHandler(this.Page_Load);

}
#endregion


private void InitializeGridComponent()
{
this.grid1.InitializeLayout += new Infragistics.WebUI.UltraWebGrid.InitializeLayoutEventHandler(this.grid1_InitializeLayout);
//this.grid1.UpdateCellBatch += new Infragistics.WebUI.UltraWebGrid.UpdateCellBatchEventHandler(this.grid1_UpdateCellBatch);
//this.gridDocLink.UpdateCellBatch += new Infragistics.WebUI.UltraWebGrid.UpdateCellBatchEventHandler(this.gridDocLink_UpdateCellBatch);
// this.gridDocLink.DeleteRowBatch += new Infragistics.WebUI.UltraWebGrid.DeleteRowBatchEventHandler(this.gridDocLink_DeleteRowBatch);
// this.gridDocLink.AddRowBatch += new Infragistics.WebUI.UltraWebGrid.AddRowBatchEventHandler(this.gridDocLink_AddRowBatch);



}
}
}


rmr

QuestionRuntimeTabstrip Control Pin
shivarishxxxx6-Sep-06 3:22
shivarishxxxx6-Sep-06 3:22 
AnswerRe: RuntimeTabstrip Control Pin
g00fyman6-Sep-06 3:50
g00fyman6-Sep-06 3:50 
GeneralRe: RuntimeTabstrip Control [modified] Pin
shivarishxxxx6-Sep-06 4:13
shivarishxxxx6-Sep-06 4:13 
GeneralRe: RuntimeTabstrip Control Pin
g00fyman6-Sep-06 4:41
g00fyman6-Sep-06 4:41 
QuestionAuthentication Problems Pin
HRiazi6-Sep-06 3:18
HRiazi6-Sep-06 3:18 
AnswerRe: Authentication Problems Pin
g00fyman6-Sep-06 4:49
g00fyman6-Sep-06 4:49 
AnswerAuthentication Problems Pin
Britney S. Morales6-Sep-06 11:03
Britney S. Morales6-Sep-06 11:03 
GeneralRe: Authentication Problems Pin
Not Active6-Sep-06 11:15
mentorNot Active6-Sep-06 11:15 
QuestionGof Design pattern Pin
Parwej Ahamad6-Sep-06 3:09
professionalParwej Ahamad6-Sep-06 3:09 
AnswerRe: Gof Design pattern Pin
Colin Angus Mackay6-Sep-06 3:15
Colin Angus Mackay6-Sep-06 3:15 
AnswerRe: Gof Design pattern Pin
g00fyman6-Sep-06 3:42
g00fyman6-Sep-06 3:42 
AnswerRe: Gof Design pattern Pin
Not Active6-Sep-06 6:50
mentorNot Active6-Sep-06 6:50 
GeneralRe: Gof Design pattern Pin
Parwej Ahamad6-Sep-06 21:12
professionalParwej Ahamad6-Sep-06 21:12 
QuestionSession variables help needed Pin
Naveed Kamboh6-Sep-06 2:17
Naveed Kamboh6-Sep-06 2:17 
AnswerRe: Session variables help needed Pin
g00fyman6-Sep-06 2:29
g00fyman6-Sep-06 2:29 
QuestionHow to change the skin of a web site? Pin
thomas_joyee6-Sep-06 2:03
thomas_joyee6-Sep-06 2:03 
AnswerRe: How to change the skin of a web site? Pin
minhpc_bk6-Sep-06 2:07
minhpc_bk6-Sep-06 2:07 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.