Search This Blog

Friday, December 23, 2005

Cider's intellesense

Merry Christmas!!!

It's christmas time and I thought of using this spare time to try out the new WPF designer in VS2005. Well immediately I encountered a small glitch.

Problem: Once you place a control on a Panel or a Grid, VS2005 doesn't update the intellesense. Then I thought it is because you do not give a name to the control in XAML. Even giving it a name didn't work.

Solution: Compile the code and then check it. Bingo!!! You can see the controls listed in the intellesense.

Once again have a merry Christmas!!!

Tuesday, December 20, 2005

ASP.NET templates

Most guys would have looked into themes in ASP.NET 2.0. Microsoft has released a set of templates for ASP.NET 2.0 for those who need to get a head around master pages and xhtml standards-compliant templates

http://msdn.microsoft.com/asp.net/reference/design/templates
/default.aspx

I liked them because they are straight out of the box, and can use easily.

Play music with .NET this holiday season

Yes, Don Box shows how to play piano with .NET. Want to check it out, click here.

Enjoy the piano.

Friday, December 02, 2005

DataGrid Pagination in Webparts

Today I had an issue with a data grid on a web part not paginating. After a bit of merry-go-around the web I could figure out how to do it.

The following is the sequence of steps.

Step 1: Set up your CreateChildControls

protected override void CreateChildControls()
{
dGrid = new DataGrid();
// write code to set up the data grid
// with your columns etc.

dGrid .PageIndexChanged +=new DataGridPageChangedEventHandler(dGrid _PageIndexChanged);

base.Controls.Add(dGrid);
base.CreateChildControls();
}

Step 2: Create the PageIndexChanged Event handler
private void dGrid_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e )
{
dGrid .CurrentPageIndex = e.NewPageIndex;
dGrid.DataSource = dtSource;
dGrid.DataBind();
}

Step 3: Render the DataGrid

protected override void RenderWebPart(HtmlTextWriter output)
{
output.Write(SPEncode.HtmlEncode(Text));
dGrid.RenderControl(output);
}



You should be in business. Happy coding guys.