Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
590 views
I've specified back ground color for my grid rows based on the text in one of the columns. The issue I'm facing is the background color disappears and becomes white when I sort the column. This happens only in IE 6 and not in the higher versions. Here is the item databound event and the grid definition. Note: I populate the grid using "need datasource event".

 <telerik:RadGrid ID="glBabies"                     
                     runat="server"
                     AllowSorting="True"
                     AutoGenerateColumns="False"
                     EnableAjax="true"
                     GridLines="None"
                     AllowPaging="False"                                        
                     onneeddatasource="glBabies_NeedDataSource"
                     OnItemDataBound="glBabies_ItemDataBound"
                    >
            <ExportSettings ExportOnlyData="true" IgnorePaging="false" OpenInNewWindow="true"  FileName="Tribune Export" />         
            <MasterTableView Width="100%" DataKeyNames="PortraidID" AutoGenerateColumns="False">
                        <columns>    
                        <telerik:GridTemplateColumn UniqueName="CheckBoxTemplateColumn">
                            <HeaderTemplate>
                             <asp:CheckBox id="headerChkbox" OnCheckedChanged="ToggleSelectedState" AutoPostBack="True" runat="server"></asp:CheckBox>
                            </HeaderTemplate>
                            <ItemTemplate>
                                <asp:CheckBox id="CheckBox1" OnCheckedChanged="ToggleRowSelection"  runat="server"></asp:CheckBox>
                            </ItemTemplate>
                            <ItemStyle Width="10px" />
                        </telerik:GridTemplateColumn>                                                    
                            <telerik:GridBoundColumn DataField="PortraidID" HeaderText="Portrait ID" SortExpression="PortraidID" UniqueName="PortraidID" >
                                <HeaderStyle Width="10px" />
                                <ItemStyle HorizontalAlign="Left" />
                                <ItemStyle Width="10px" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="FirstName" HeaderText="Name" SortExpression="FirstName" UniqueName="FirstName">
                            <HeaderStyle Width="75px" /><ItemStyle HorizontalAlign="left" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="MotherFN" HeaderText="Parents" SortExpression="MotherFN" UniqueName="Parents">
                             <HeaderStyle Width="125px" /><ItemStyle HorizontalAlign="Left" />
                            </telerik:GridBoundColumn>    
                             <telerik:GridBoundColumn DataField="Weight" HeaderText="Weight" SortExpression="Weight" UniqueName="Weight">
                            <HeaderStyle Width="75px" /><ItemStyle HorizontalAlign="Left" />
                            </telerik:GridBoundColumn>    
                            <telerik:GridBoundColumn DataField="Date" HeaderText="Date" SortExpression="Date" UniqueName="Date" DataType="System.DateTime" >
                            <HeaderStyle Width="75px" /><ItemStyle HorizontalAlign="Left" />
                            </telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="Sex" HeaderText="Sex" SortExpression="Sex" UniqueName="Sex" Display="false"></telerik:GridBoundColumn>    
                            <telerik:GridBoundColumn DataField="FatherFN" SortExpression="FatherFN" UniqueName="FatherFN" Display="false"></telerik:GridBoundColumn>
                            <telerik:GridBoundColumn DataField="MiddleName" SortExpression="MiddleName" UniqueName="MiddleName" Display="false"></telerik:GridBoundColumn>        
                        </columns>
                    </MasterTableView>
    </telerik:RadGrid>

Code behind:



protected void glBabies_ItemDataBound(object sender, Telerik.Web.UI.GridItemEventArgs e)
    {
        if (e.Item is GridDataItem)
        {
            if (e.Item.Cells[10].Text != "" && e.Item.Cells[10].Text != "&nbsp;")
                e.Item.Cells[4].Text = e.Item.Cells[4].Text + " " + e.Item.Cells[10].Text;
            if (e.Item.Cells[8].Text == "Female")
            {
                e.Item.BackColor = System.Drawing.ColorTranslator.FromHtml("#fdebfb");
                if (e.Item.Cells[9].Text != "" && e.Item.Cells[9].Text != "&nbsp;")
                    e.Item.Cells[5].Text = "Daughter of " + e.Item.Cells[5].Text + " & " + e.Item.Cells[9].Text;
                else
                    e.Item.Cells[5].Text = "Daughter of " + e.Item.Cells[5].Text;
            }
            else
            {
                e.Item.BackColor = System.Drawing.ColorTranslator.FromHtml("#dfe7fa");
                if (e.Item.Cells[9].Text != "" && e.Item.Cells[9].Text != "&nbsp;")
                    e.Item.Cells[5].Text = "Son of " + e.Item.Cells[5].Text + " & " + e.Item.Cells[9].Text;
                else
                    e.Item.Cells[5].Text = "Son of " + e.Item.Cells[5].Text;
            }
        }
    }
Dimo
Telerik team
 answered on 18 Sep 2009
3 answers
129 views
Is it possible to use the SelectedDate in RadCalendar as a parameter for  an ObjectDataSource? I wish to filter the records shown on my page, based on the date the user picks in the calendar, or is there another way to do this? I can't seem to find any examples on this...
Martin
Telerik team
 answered on 18 Sep 2009
1 answer
91 views
Hi

Thought Id share an issue I had today with combobox's that are related like the example at http://demos.telerik.com/aspnet-ajax/combobox/examples/functionality/multiplecomboboxes/defaultcs.aspx

Basically if you add items to the code infront like this:

            <telerik:RadComboBox ID="RadComboBox3"   
                runat="server"   
                Width="186px"   
                CssClass="ComboBox_Cities"   
                OnClientItemsRequested="ItemsLoaded"   
                OnItemsRequested="RadComboBox3_ItemsRequested" 
                AppendDataBoundItems="true"   
                ShowMoreResultsBox="false" 
                NoWrap="true" 
                EnableScreenBoundaryDetection="false"   
                EmptyMessage="Type a city name"   
                AllowCustomText="false"   
                MarkFirstMatch="true">  
                <Items> 
                    <telerik:RadComboBoxItem Text="other, please specify" Value="-1" /> 
                </Items> 
            </telerik:RadComboBox>    

Then you will not get a SelectedValue returned when you submit the form. You get the Text property but not SelectedValue. Solution is to add these default RadComboBoxItems after you have databound the others in the OnItemsRequested handler.

Not sure if this is an actual issue with the control, or that a warning needs to be put somewhere, but this is something Im sure others would want to do in future.
Simon
Telerik team
 answered on 18 Sep 2009
1 answer
128 views
Im looking to mark biweekly dates on a cal to show pay days.  This code works but it only shows on the current calendar how do I modify it so if the scroll thru the mutiple months those days show up as marked?


   Private Sub Page_Load(ByVal sender As ObjectByVal e As Telerik.Web.UI.Calendar.DayRenderEventArgs) Handles RadCalendar1.DayRender  
        startDate = CType(RadCalendar1.CalendarView, MonthView).MonthStartDate  
        endDate = CType(RadCalendar1.CalendarView, MonthView).MonthEndDate  
        Dim _Date As Date = "2009-09-11" 
 
        Do While _Date <= Now.AddYears(1)  
            DayOfMonth = _Date.Day  
            MonthMonth = _Date.Month  
            YearYear = _Date.Year  
 
            Dim CurrentDate As DateTime = e.Day.Date 
            If startDate <= CurrentDate And CurrentDate <= endDate Then 
                If CurrentDate.Day = DayOfMonth And CurrentDate.Month = MonthMonth And CurrentDate.Year Then 
                    Dim currentCell As TableCell = e.Cell  
                    currentCell.Style("background-color") = "green" 
                End If 
            End If 
            _Date = _Date.AddDays(14)  
        Loop 
    End Sub 
Dimo
Telerik team
 answered on 18 Sep 2009
1 answer
81 views
Hi,

I wonder if the following can be done for the table function in the editor.

1. Set  <table cellspacing=”0” cellpadding=”0” border=”0”> to be default.
2. Could CSS and Back Image options be turned off for the table wizard?

Kind Regards
Cecilia
Tervel
Telerik team
 answered on 18 Sep 2009
1 answer
139 views
I'm trying to track down some issues with invalid viewstate errors on my site. It is already the case that the site is using a specific machine key in the config file. One item noted on this post (http://bytes.com/topic/asp-net/answers/861764-invalid-viewstate-system-string-decryptstringwithiv) is that some of the script blocks are not wrapped in CDATA. In looking at the source for my site, I too notice that none of my blocks are wrapped in CDATA blocks which surprised me given that they are all wrapped in RadCodeBlocks.

Is it the case that RadCodeBlocks do not automatically wrap their contents in CDATA blocks when the DOCTYPE is set to XHTML? Is there a setting on the RadCodeBlocks to have it do so?
Dimo
Telerik team
 answered on 18 Sep 2009
3 answers
106 views

Hi,

Iam able to create a summary of appointments in the month view by following thesuggestions in this thread

http://www.telerik.com/community/forums/aspnet-ajax/scheduler/customize-event-template-in-month-view.aspx

Iwould like this to happen only in the month view. How to stop it from happeningin the other views?

Thanks

Sabrish

Peter
Telerik team
 answered on 18 Sep 2009
1 answer
98 views
Hi ,

I am trying to (not successfully) To format various cells of the 2 DetailTables in my grid, when exporting to PDF  (using Vers 9.1).

a)  the formatting is not showing (though the code beneath does get entered, execute)
b) stepping thru , shows all cells to have &nbsp; in them...so checking for 

if (item.Cells[j].Text == "Policy Information")

 

{

....Apply some formatting...
}
    never actually meets the condition and executes.

eg. my  Code from  the "ItemCreated" Event

if

 

( e.Item.OwnerTableView.Name == "ClientSchedDetl" )

 

{

 

if (e.Item is GridDataItem)

 

{

 

int j = 0;

 

 

GridDataItem item = e.Item as GridDataItem;

 

 

foreach (TableCell cell in item.Cells)

 

{

 

 

if (item != null)

 

{

 

 

if (item.Cells[j].Text == "Policy Information")

 

{

item[

"Policy Information"].Style["height"] = "20px";

 

 

//item["EnglishName"].Style["font-weight"] = "bolder";

 

 

//item["Description"].Style["font-size"] = "10px";

 

 

//item["OriginalName"].Style["font-family"] = "Arial Unicode MS";

 

 

//item["OriginalName"].Style["color"] = "#bbbbbb";

 

 

//item["Description"].Style["text-align"] = "center";

 

cell.Style[

"font-family"] = "Arial Unicode MS";

 

cell.Style[

"text-align"] = "left";

 

cell.Style[

"font-size"] = "16px";

 

cell.Style[

"height"] = "24px";

 

cell.Style[

"font-weight"] = "bold";

 

}

 

else

 

{

 

if (j == 0)  //Column One  (no DataKey entries so 0 is the first visble column) MAKE BOLD

 

{

cell.Style[

"font-family"] = "Arial Unicode MS";

 

cell.Style[

"text-align"] = "left";

 

cell.Style[

"font-size"] = "13px";

 

cell.Style[

"height"] = "24px";

 

cell.Style[

"font-weight"] = "bold";

 

}

 

else //Columns two and on..Non-Bold

 

{

cell.Style[

"font-family"] = "Arial Unicode MS";

 

cell.Style[

"text-align"] = "left";

 

cell.Style[

"font-size"] = "10px";

 

cell.Style[

"height"] = "24px";

 

 

//cell.Style["font-weight"] = "normal";

 

}

}

j += 1;

}

}

thanks
Neal

Daniel
Telerik team
 answered on 18 Sep 2009
1 answer
278 views
Hi,

I'm having an issue where I have an ajaxified RadGrid and RadAjaxLoadingPanel panel defined.

The RadAjaxLoadingPanel  shows up fine in most cases but I can't get it to show up
when I change the pageSize of my RadGrid and have no idea how to refernce the pageSize
dropdown itself to get it to show the panel. Could anyone help with this issue? Thanks!
Mira
Telerik team
 answered on 18 Sep 2009
1 answer
128 views
Hi. How can I get a reference to a RadEditor in a

RadPageView? I tried

 

$find("<%=RadEditor1.ClientID%>"); but it returs null. Is it because its in a

 

RadPageView which is inside a RadMultiPage, which is inside a RadPane, which is inside a RadSplitter, etc?

I have a reference to the RadPageView that the RadEditor is in obtained with  multiPage.get_pageViews().getPageView(x)

Thanks,
Brian

 

Tervel
Telerik team
 answered on 18 Sep 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Simon
Top achievements
Rank 2
Iron
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Marco
Top achievements
Rank 4
Iron
Iron
Iron
Grant
Top achievements
Rank 3
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?