Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Web Development
  3. ASP.NET
  4. Infragistics ultrawebgrid

Infragistics ultrawebgrid

Scheduled Pinned Locked Moved ASP.NET
designhelpquestion
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    shivarishxxxx
    wrote on last edited by
    #1

    Can anybody help me to bind data to Ultrawebgrid at runtime dynamically? I dont want to create it at design time at all. When I bind ultrawebgrid just like datagrid, it says, object reference not set to an instance of an object. using Infragistics.WebUI.UltraWebGrid; protected Infragistics.WebUI.UltraWebGrid.UltraWebGrid grid1 ; grid1 = new Infragistics.WebUI.UltraWebGrid.UltraWebGrid(); grid1.DataSource = dataset; grid1.DisplayLayout.AutoGenerateColumns = true; grid1.DataBind(); Please help

    rmr

    G 1 Reply Last reply
    0
    • S shivarishxxxx

      Can anybody help me to bind data to Ultrawebgrid at runtime dynamically? I dont want to create it at design time at all. When I bind ultrawebgrid just like datagrid, it says, object reference not set to an instance of an object. using Infragistics.WebUI.UltraWebGrid; protected Infragistics.WebUI.UltraWebGrid.UltraWebGrid grid1 ; grid1 = new Infragistics.WebUI.UltraWebGrid.UltraWebGrid(); grid1.DataSource = dataset; grid1.DisplayLayout.AutoGenerateColumns = true; grid1.DataBind(); Please help

      rmr

      G Offline
      G Offline
      g00fyman
      wrote on last edited by
      #2

      ok that should work although i normally set the DataMember Property as well, so, it must be taht your dataset is not instantiated? can you post more complete code, including funcitons called from? my best practice for this is to use the designer to bind to a dataset at design time, then change the reference in Pre_Render() like so:

      this.dataset = new DataSet();

      //
      // fill ds here
      //

      this.ultraGrid1.DataSource = this.dataset;
      this.ultraGrid1.DataMemeber = "DataTable";
      this.ultraGrid1.DataBind();

      obviously "DataTable" is the name of the table the band is bound to in the grid. regs, g00fy

      S 1 Reply Last reply
      0
      • G g00fyman

        ok that should work although i normally set the DataMember Property as well, so, it must be taht your dataset is not instantiated? can you post more complete code, including funcitons called from? my best practice for this is to use the designer to bind to a dataset at design time, then change the reference in Pre_Render() like so:

        this.dataset = new DataSet();

        //
        // fill ds here
        //

        this.ultraGrid1.DataSource = this.dataset;
        this.ultraGrid1.DataMemeber = "DataTable";
        this.ultraGrid1.DataBind();

        obviously "DataTable" is the name of the table the band is bound to in the grid. regs, g00fy

        S Offline
        S Offline
        shivarishxxxx
        wrote on last edited by
        #3

        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.F

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups