Thursday, June 18, 2009

show or hide nested table views RadGrid SP1 Q1 2009

protected void ShowOrHideNestedTableView()
{
foreach (GridDataItem CS in rgABC.Items)
{

if (CS.OwnerTableView.Name == "AAA")
{
if (cb123.Checked)
{
CS.Parent.Visible = true;
CS.Visible = true;
}
else
{
CS.Parent.Visible = false;
CS.Visible = false;
}
}

}
}

protected void rgScheduleList_PreRender(object sender, EventArgs e)
{
ShowOrHideNestedTableView();
}

Wednesday, June 17, 2009

aspx c# open new window in button click event when the button is placed inside an ajax update panel

val1 is an integer
val2 is a boolean

System.Text.StringBuilder sb = new System.Text.StringBuilder();
sb.Append("window.open(abc.aspx?val1=" + val1Value.ToString() + "');");
ScriptManager.RegisterClientScriptBlock(this.upd1, this.upd1.GetType(), "abc", sb.ToString(), true);

aspx passing on multiple parameter values in URL

val1 is an integer
val2 is a boolean


in page 1:

aspx:

c#:
RadAjaxManager.GetCurrent(Page).ResponseScripts.Add("xxx('" + val1+ "',true);");

in page 2
c#
if (!string.IsNullOrEmpty(Request["val2"]))
{
if (bool.Parse(Request["val2"]))
----logic here---------
}


if (!string.IsNullOrEmpty(Request["val1"]))
{
if (int.Parse(Request["val1"])>0)
----logic here---------
}

Thursday, June 04, 2009

COALESCE

use COALESCE to manage a nullable db value, reference:
http://msdn.microsoft.com/en-us/library/ms190349.aspx