How to add a TemplateColumn dynamically to Repeater

Refer : How to add Templatecolumn dynamically to DataList? Now, instead of DataList use Repeater and make below changes VB.NET Public Sub BindLabelColumn(sender As Object, e As EventArgs) Dim lbl As Label = CType(sender, Label) Dim container As RepeaterItem = CType(lbl.NamingContainer, RepeaterItem) Dim strVals As String = Convert.ToString(DataBinder.Eval(CType(container, RepeaterItem).DataItem, 'LastName')) + ', ' + Convert.ToString(DataBinder.Eval(CType(container, RepeaterItem).DataItem, 'FirstName')) lbl.Text = strVals End Sub ’BindLabelColumn C# public void BindLabelColumn(object sender, EventArgs e) { Label lbl = (Label)sender; RepeaterItem container = (RepeaterItem)lbl.NamingContainer ; String strVals =Convert.ToString(DataBinder.Eval(((RepeaterItem)container).DataItem, 'LastName')) + ', ' + Convert.ToString(DataBinder.Eval(((RepeaterItem)container).DataItem, 'FirstName')) ; lbl.Text = strVals; }

How do I use Validator controls while editing data in the DataGrid?

Yes, you can use the Asp.Net validation controls inside a Datagrid. You’ll need to use a TemplateColumn, and on the TextBoxes (or other controls) in your EditItemTemplate, be sure to give them an ID. Then specify that ID as the ControlToValidate for the validation control. Refer How to edit data in DataGrid using TemplateColumn?

How can I use a Calendar Control to show specific dates highlighted and display relevant data for that date

<asp:Calendar id='Calendar1' OnDayRender ='CalDayRender' runat='server'></asp:Calendar> Dim ds As DataSet Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load ’Put user code to initialize the page here ’Fill the DataSet End Sub Protected Sub CalDayRender(ByVal sender As Object, ByVal e As DayRenderEventArgs) Dim strName As New StringBuilder strName.Append(' ') Dim theDay As DateTime = e.Day.Date Dim sql As String = 'hiredate=’' + DateTime.Parse(theDay.ToString('d')) + '’ ' Dim dr As DataRow() = ds.Tables(0).Select(sql) Dim drRow As DataRow For Each drRow In dr strName.Append('’<a href=empdetails.aspx?id=' + drRow('Employeeid').ToString() + '>' + drRow('FirstName').ToString() + ' ' + drRow('LastName').ToString() + '</a><br>’') e.Cell.BackColor = Color.Teal e.Cell.ForeColor = Color.Wheat Next drRow strName.Append('') e.Cell.Controls.Add(New LiteralControl(strName.ToString())) End Sub ’CalDayRender C# DataSet ds ; private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here //Populate the DataSet } protected void CalDayRender(object sender, DayRenderEventArgs e) { StringBuilder strName = new StringBuilder(); strName.Append(' '); DateTime theDay = e.Day.Date; string sql ='hiredate=’' + DateTime.Parse ( theDay.ToString('d')) + '’ '; DataRow [] dr = ds.Tables[0].Select(sql); foreach(DataRow drRow in dr) { strName.Append('’<a href=empdetails.aspx?id=' + drRow('Employeeid').ToString() + '>' + drRow('FirstName').ToString() + ' ' + drRow('LastName').ToString() + '</a><br>’') e.Cell.BackColor = Color.Teal; e.Cell.ForeColor = Color.Wheat; } strName.Append(''); e.Cell.Controls.Add(new LiteralControl(strName.ToString())); }

Why doesn’t my Collection Properties get saved in the aspx file properly during design-time?

Some common mistakes that will cause the designer to choke while persisting collection properties are: The corresponding collection type cannot have multiple (overloaded) indexers. You should always define a single indexer of the type ‘public SomeType this[object obj]{…}‘. Otherwise the changes will be persisted but the control will not load in the designer. You will see a ‘Ambiguous match found’ error. If the collection property has the PersistenceMode attribute set to InnerProperty then the property should not include a set method.

How can MultiView Control be created in 2.0?

A MultiView is a non-visual control that provides a pallette where a several view Controls can be placed. A view control is another non-visual control where you can place the user interface controls.It is simillar to that of a Tab control.The below code demonstrate how MultiView can be created, <div> <asp:Button id='Button1' runat='server' Text='View 1' OnClick='Button1_Click' /> <asp:Button id='Button2' runat='server' Text='View 2' OnClick='Button2_Click' /> <asp:Button id='Button3' runat='server' Text='View 3' OnClick='Button3_Click' /> <br /> <br /> <asp:MultiView id='MultiView1' runat='server' ActiveViewIndex=0> <asp:View id='View1' runat='server'> Content Here (View 1)... <asp:BulletedList ID='BulletedList1' runat='server'> <asp:ListItem>My Schedule On 1st Week</asp:ListItem> <asp:ListItem>My Schedule On 2nd Week</asp:ListItem> <asp:ListItem>My Schedule On 3rd Week</asp:ListItem> <asp:ListItem>My Schedule On 4th Week</asp:ListItem> </asp:BulletedList> </asp:View> <asp:View id='View2' runat='server'> Content Here (View 2)... <asp:Calendar ID='Calendar1' runat='server' BackColor='#FFFFCC' BorderColor='#FFCC66' BorderWidth='1px' DayNameFormat='Shortest' Font-Names='Verdana' Font-Size='8pt' ForeColor='#663399' Height='200px' ShowGridLines='True' Width='220px'> <SelectedDayStyle BackColor='#CCCCFF' Font-Bold='True' /> <TodayDayStyle BackColor='#FFCC66' ForeColor='White' /> <SelectorStyle BackColor='#FFCC66' /> <OtherMonthDayStyle ForeColor='#CC9966' /> <NextPrevStyle Font-Size='9pt' ForeColor='#FFFFCC' /> <DayHeaderStyle BackColor='#FFCC66' Font-Bold='True' Height='1px' /> <TitleStyle BackColor='#990000' Font-Bold='True' Font-Size='9pt' ForeColor='#FFFFCC' /> </asp:Calendar> </asp:View> <asp:View id='View3' runat='server'> Content Here (View 3)... <br /> <asp:Label ID='Label1' runat='server' Text='Schedule Details'></asp:Label> </asp:View> </asp:MultiView> </div>