Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
75 views
Hello!

I'm using IE9 Preview 6 and have a problem with columns that has percent widths and using scroll and static headers in the grid.
In the following example, the grid doesn't get the correct width:
<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm1.aspx.vb" Inherits="WebApplication4.WebForm1" %>
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<head runat="server">
    <title></title>
    <script runat="server">
        Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
            Dim dt As New System.Data.DataTable()
            dt.Columns.Add("Col1", GetType(String))
            dt.Columns.Add("Col2", GetType(String))
            For i As Integer = 0 To 50
                dt.Rows.Add({"Row" & i, "Data"})
            Next
            rg.DataSource = dt
            rg.DataBind()
        End Sub
    </script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager" runat="server">
    </asp:ScriptManager>
    <div>
        <telerik:RadGrid ID="rg" runat="server" AutoGenerateColumns="false">
            <ClientSettings>
                <Scrolling AllowScroll="true" ScrollHeight="200px" UseStaticHeaders="true" />
            </ClientSettings>
            <MasterTableView>
                <Columns>
                    <telerik:GridBoundColumn DataField="Col1" HeaderText="Col1">
                        <HeaderStyle Width="50%" />
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="Col2" HeaderText="Col2">
                        <HeaderStyle Width="50%" />
                    </telerik:GridBoundColumn>
                </Columns>
            </MasterTableView>
        </telerik:RadGrid>
    </div>
    </form>
</body>
</html>


Test the sample and see the difference in IE8 and IE9!

In the resulting html I can see that the inner table rgMasterTable doesn't have the style width:100%, which it has in IE8.

I'm using 2010 Q3 release.

Regards
Caesar
Dimo
Telerik team
 answered on 17 Nov 2010
3 answers
138 views
Hi,

I have a aspx page, and in that page i have a gridview with place holder as a item. i am binding some user controls which contains radgrid, and are being add to place holder dynamically.

the problem is: the radcontrols item events are not firing.
but when i use them in saperate aspx page, everything works fine.

Could you please take a look at following code and help us...

Thank you
v.

aspx page
<asp:GridView ID="EvalGridView" runat="server" AutoGenerateColumns="False" DataKeyNames="ID"
        >
       <Columns>
           <asp:TemplateField HeaderText="EVALUATION FOR THE " SortExpression="Requirements">
               <ItemTemplate>
                     
                   <asp:Label ID="ControlNameLabel" runat="server" Text='<%# Bind("ControlName") %>' Visible="false" /> 
                   <asp:Label ID="ShowDropDown" runat="server" Text='<%# Bind("Qualified") %>' Visible="false" />
                   <asp:Label ID="ShowCheckBox" runat="server" Text='<%# Bind("ChoiceBox") %>' Visible="false" />
                   <asp:Label ID="lblEducatorEvaluationsID" runat="server" Text='<%# Bind("ID") %>' Visible="false" />
                   <asp:UpdatePanel ID="updpnlEval" runat="server">
                       <ContentTemplate>
                           <asp:Table id="tblEvalTable" runat="server">
                               <asp:TableRow VerticalAlign="Top">
                                   <asp:TableCell width="60px" ID="td1" runat="server">
                                       <asp:DropDownList ID="ddlYorN" Width="60px" runat="server" >
                                           <asp:ListItem Value="0" Text="Select" Selected="True" />
                                           <asp:ListItem Value="1" Text="Yes" />
                                           <asp:ListItem Value="2" Text="No"  />                                                                                   
                                       </asp:DropDownList>
                                   </asp:TableCell>
                                   <asp:TableCell width="20px" ID="td2" runat="server">
                                       <asp:CheckBox ID="chkReqConsidered" runat="server" />
                                   </asp:TableCell>
                                   <asp:TableCell>
                                   </asp:TableCell>
                                   <asp:TableCell>
                                       <asp:Label ID="RequirementsLabel" runat="server" Text='<%# Bind("Requirements") %>' CssClass="normal" />
                                       <br />
                                       <asp:PlaceHolder runat="server" ID="phUserControl"  />   
                                   </asp:TableCell>
                                   <asp:TableCell>
                                       <asp:LinkButton ID="lnkbtnAddOrUpdateCredentials" CssClass="bottomhyperlink" CommandArgument='<%# Bind("ID") %>' style="float:right;" runat="server">
                                       </asp:LinkButton>                                    
                                   </asp:TableCell>
                               </asp:TableRow>
                           </asp:Table>
                       </ContentTemplate>
                   </asp:UpdatePanel>
                   <asp:UpdateProgress DynamicLayout="false" ID="updpnlprgTechEval" runat="server">
                       <ProgressTemplate>
                           <div style="position: fixed; top: 0%; right: 50%; background-color: #FFFFBC; padding: 2em 2em 2em 2em;
                               font-weight: bolder; border: solid .1em Brown">
                               <img alt="Processing your request, Please wait"  src="../Images/indicator.gif" />
                               Please wait...
                           </div>
                       </ProgressTemplate>
                   </asp:UpdateProgress>                    
               </ItemTemplate>
           </asp:TemplateField>
       </Columns>
   </asp:GridView>


ascx control
<telerik:RadGrid ID="radGridCourseInfo" runat="server" Width="100%" AllowSorting="true"
        AutoGenerateColumns="False" GridLines="None" Skin="Simple" ShowStatusBar="True"
        ShowFooter="true" OnItemCommand="radGridCourseInfo_ItemCommand" OnItemCreated="radGridCourseInfo_ItemCreated"
        OnNeedDataSource="radGridCourseInfo_NeedDataSource" OnItemDataBound="radGridCourseInfo_ItemDataBind">
        <ClientSettings EnableRowHoverStyle="true">
            <Selecting AllowRowSelect="true" />
            <Scrolling UseStaticHeaders="true" />
        </ClientSettings>
        <MasterTableView DataKeyNames="EducatorCoursesID" Width="100%" ShowHeadersWhenNoRecords="true"
            TableLayout="Auto" EditMode="EditForms" CommandItemSettings-AddNewRecordText="Add New Course">
            <NoRecordsTemplate>
                No Records Available.
            </NoRecordsTemplate>
            <Columns>
                <telerik:GridButtonColumn ButtonType="ImageButton" CommandName="Delete" Text="Delete"
                    ConfirmText="Are you sure you want to delete this Course.?" ConfirmDialogType="RadWindow"
                    UniqueName="DeleteColumn" ImageUrl="~/Images/delete.gif" ItemStyle-Width="2%"
                    ItemStyle-HorizontalAlign="Center" HeaderText="Delete">
                </telerik:GridButtonColumn>
                <telerik:GridBoundColumn DataField="EducatorEvaluationID" UniqueName="SelectedEducatorEvaluationID"
                    Visible="false">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="CourseNumber" HeaderText="COURSE" ItemStyle-Width="45%"
                    UniqueName="Course" SortExpression="CourseNumber">
                    <HeaderStyle Width="45%" />
                    <ItemStyle Width="45%" />
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="CreditHourInput" HeaderText="HOURS" ItemStyle-Width="45%"
                    UniqueName="CreditHourInput" SortExpression="CreditHourInput">
                    <HeaderStyle Width="45%" />
                    <ItemStyle Width="45%" />
                </telerik:GridBoundColumn>
            </Columns>
            <EditFormSettings CaptionFormatString="Edit ID: {0}" CaptionDataField="EducatorCoursesID"
                EditFormType="Template" PopUpSettings-Modal="true">
                <FormTemplate>
                    <br />
                    <asp:Panel ID="pnlCourses" runat="server" GroupingText="Add Course Information">
                        <br />
                        <table>
                            <tr valign="top">
                                <td>
                                    <asp:Label ID="lblCourses" runat="server" Text="Course" CssClass="label" Style="margin: 0 0 0 0" />
                                </td>
                                <td>
                                    <img src="../Images/required.png" alt="Required Field" />
                                </td>
                                <td>
                                    <asp:TextBox ID="txtCourseNumber" EnableViewState="true" runat="server" CssClass="input" />
                                </td>
                                <td>
                                </td>
                            </tr>
                            <tr valign="top">
                                <td>
                                    <asp:Label ID="lblHours" runat="server" Text="Hours" CssClass="label" Style="margin: 0 0 0 0" />
                                </td>
                                <td>
                                    <img src="../Images/required.png" alt="Required Field" />
                                </td>
                                <td>
                                    <asp:TextBox ID="txtCourseHours" EnableViewState="true" runat="server" CssClass="input integerOnly" />
                                </td>
                                <td>
                                    <telerik:RadComboBox ID="radCboHoursType" runat="server" Skin="Simple" Width="100px"
                                        Height="100px">
                                    </telerik:RadComboBox>
                                </td>
                            </tr>
                        </table>
                        <br />
                        <asp:Label ID="lblAddErrorMsg" runat="server"></asp:Label>
                        <br />
                        <asp:Button ID="btnSave" CssClass="buttonGreen" Text="ADD" runat="server" CommandName="PerformInsert" />
                        <asp:Button ID="btnCancel" CssClass="buttonRed" Text="Cancel" runat="server" CausesValidation="False"
                            CommandName="Cancel"></asp:Button>
                    </asp:Panel>
                </FormTemplate>
            </EditFormSettings>
        </MasterTableView>
        <PagerStyle Mode="NextPrevAndNumeric" />
    </telerik:RadGrid>


code behind for ascx:
protected void radGridCourseInfo_ItemCommand(object source, GridCommandEventArgs e)
{
    if (e.CommandName == RadGrid.InitInsertCommandName)
    {
    }
    else if (e.CommandName == RadGrid.PerformInsertCommandName)
    {
        TextBox otxtCourseNumber = (TextBox)(e.Item.FindControl("txtCourseNumber"));
        TextBox otxtCourseHours = (TextBox)(e.Item.FindControl("txtCourseHours"));
        RadComboBox oradCboHoursType = (RadComboBox)(e.Item.FindControl("radCboHoursType"));
        CheckBox chkSelect = (CheckBox)(e.Item.FindControl("chkSelect"));
        if (otxtCourseNumber != null && otxtCourseHours != null && oradCboHoursType != null)
        {
            if ((Utility.IsEmpty(otxtCourseHours.Text.ToString()) && !Utility.IsDecimal(otxtCourseHours.Text.ToString()))
                || Utility.IsEmpty(otxtCourseNumber.Text.ToString()))
            {
                mMessage = "'Course' and 'Hours' are Required.";
            }
            else if (oradCboHoursType.SelectedValue == "0")
            {
                mMessage = "Select Hours Type";
            }
            else
            {
                EducatorCourseEntity oECE = new EducatorCourseEntity();
                oECE.EducatorID = m_lEducatorID;
                oECE.CourseNumber = Utility.ReturnString(otxtCourseNumber.Text);
                oECE.HourTypeID = Utility.ReturnInteger(oradCboHoursType.SelectedValue);
                oECE.CreditHourInput = Utility.ReturnDecimal(otxtCourseHours.Text);
                oECE.CompletionDt = null;
                oECE.MaintainedBy = App.GetCurrentUserName;
                int CredentialID = InsertCourses(oECE);
                    if (CredentialID > 0)
                    {
                        mMessage = "Educator Course Inserted.";
                        radGridCourseInfo.EditIndexes.Add(-1);
                        radGridCourseInfo.Rebind();
                        if (this.EnableEvalSettings == true)
                        
                            EducatorEvaluationEntity oEEE = new EducatorEvaluationEntity();
                            oEEE.EducatorID = m_lEducatorID;
                            oEEE.EducatorCredentialID = CredentialID;
                            oEEE.CredentialTypeID = (int)Enumerations.CredentialTypeIDFor.Course;
                            oEEE.ApplicationID = this.ApplicationID;
                            oEEE.EvaluationID = this.EvaluationID;
                            oEEE.EducatorServiceID = this.EducatorServiceID;
                            oEEE.MaintainedBy = App.GetCurrentUserName;
                            //make checkbox selected upon sucessfull insertion.
                            UpdateEducatorEvaluationSelections(oEEE, Utility.ReturnDecimal(otxtCourseHours.Text));
                            this.Refresh();
                        }
                    }
                    else
                    {
                        mMessage = "Educator Course Insert Failed.";
                    }
            }
        }
        else
        {
            mMessage = "Error..";
        }
        ShowErrorMsg(mMessage);
    }
    else if (e.CommandName == RadGrid.DeleteCommandName)
    {
        EducatorCourseEntity oECE = new EducatorCourseEntity();
        oECE.EducatorCoursesID = Utility.ReturnInteger(((GridDataItem)(e.Item)).GetDataKeyValue("EducatorCoursesID"));
        oECE.EducatorID = this.EducatorID;
        mMessage = DeleteEducatorCourse(oECE) ? string.Empty : "Error: Unable to Delete Course";
    }
    else if (e.CommandName == "Cancel")
    {
        radGridCourseInfo.EditIndexes.Add(-1);
    }
}

Vasil
Telerik team
 answered on 17 Nov 2010
1 answer
130 views
Hello folks!

I just bought Telerik ASP.NET Ajax Controls and I found a thread explaining how to use the RadMessageBoxes programatically.

This is the thread i'm speaking of: http://www.telerik.com/community/code-library/aspnet-ajax/window/server-side-msgbox-user-control-for-radconfirm-radalert-and-radprompt.aspx

The problem is: I'm firing the ShowAlert method and nothing happens. I mean, when I fire it, my loading panel keeps appearing and never goes off. It just keeps there spinning and never stops.

I've made a very simple page with a button that fires the method ShowAlert and the result is the same.

Does anyone knows why this is happening?

My MessageBox instance is inside a MasterPage file, and it's not inside a panel.

Hope anyone can help me out.

Thanks

Cezar
Yana
Telerik team
 answered on 17 Nov 2010
1 answer
90 views
Hi Telerik Community , I am using RAD Controls in WinForms from almost 1 week, and i want to know how to get the expand (+)  sign in the RADGRID and how to set another grid or rows under expand sign's(+) row. Also please tell me the event related to that, as i found many event and properties different from the normal WinForms Data Grid View.
Sagar
Top achievements
Rank 1
 answered on 17 Nov 2010
1 answer
121 views
Hai

     i am using RadScheduler for my reservation.   While reservation take place on particular date (ie., insert and edit), i want to override the default popup (as in fig1) with my rad dock (as in fig2).

Thanks for in advance..
Have a great day.
Nikolay Tsenkov
Telerik team
 answered on 17 Nov 2010
3 answers
135 views
Hi,

  I have attached the png file. I have to create this using radgrid and radchart. I will have radchart at the top and it details in the radgrid. i should provide a facility to download it in a excel and pdf which should contain both chart and grid

please help

Thanks
jai
Ves
Telerik team
 answered on 17 Nov 2010
1 answer
109 views
Hi

I have a self-referencing hierachical radGrid like in my attachement

How to find checkbox control...?

I tried to count MasterTableView.Items.count but the result is always 1.
What am I missing?

Protected Sub Button1_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button1.Click
MsgBox(RadGrid1.MasterTableView.Items.Count)
For Each item As GridItem In RadGrid1.MasterTableView.Items
If TypeOf item Is GridDataItem Then
MsgBox(item.ClientID)
End If
Next
End Sub

<telerik:RadGrid ID="RadGrid1" runat="server" OnColumnCreated="RadGrid1_ColumnCreated" Skin="Office2007" Width="70%"
            OnItemCreated="RadGrid1_ItemCreated" OnItemDataBound="RadGrid1_ItemDataBound" AutoGenerateColumns="false"
             OnNeedDataSource="RadGrid1_NeedDataSource">
            <MasterTableView HierarchyDefaultExpanded="true" HierarchyLoadMode="Client" AllowSorting="true" Name="asd" DataKeyNames="mnid, mnparent,mnnameen">
            <SelfHierarchySettings ParentKeyName="mnparent" KeyName="mnid" />
            <Columns>
                <telerik:GridBoundColumn DataField="mnnameen" HeaderText="Menu" UniqueName="mnnameen"></telerik:GridBoundColumn>
                <telerik:GridTemplateColumn UniqueName="CBoxOpenTemplateColumn" HeaderText="Open" HeaderStyle-Width="70px">
                    <ItemTemplate>
                        <asp:CheckBox id="CBoxOpen" runat="server"></asp:CheckBox>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn UniqueName="CBoxFullTemplateColumn" HeaderText="Full" HeaderStyle-Width="70px">
                    <ItemTemplate>
                        <asp:CheckBox id="CBoxFull" runat="server"></asp:CheckBox>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn UniqueName="CBoxApprovalTemplateColumn" HeaderText="Approval" HeaderStyle-Width="70px">
                    <ItemTemplate>
                        <asp:CheckBox id="CBoxApproval" runat="server"></asp:CheckBox>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridTemplateColumn UniqueName="CBoxFavoriteTemplateColumn" HeaderText="Favorite" HeaderStyle-Width="70px">
                    <ItemTemplate>
                        <asp:CheckBox id="CBoxFavorite" runat="server"></asp:CheckBox>
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
            </Columns>
            </MasterTableView>
        <ClientSettings AllowExpandCollapse="true" EnableRowHoverStyle="true">
        </ClientSettings>
        </telerik:RadGrid>


in this code I change id of the checkbox
Public Sub HideExpandColumnRecursive(ByVal tableView As GridTableView)
        Dim nestedViewItems As GridItem() = tableView.GetItems(GridItemType.NestedView)
 
        Dim itemid As String, itemidnya As String
        For Each item As GridItem In tableView.Items
            If TypeOf item Is GridDataItem Then
                Dim dataItem As GridDataItem = CType(item, GridDataItem)
                Dim mnid As String = dataItem.OwnerTableView.DataKeyValues(dataItem.ItemIndex)("mnid")
                Dim mnname As String = dataItem.OwnerTableView.DataKeyValues(dataItem.ItemIndex)("mnnameen")
                itemid = dataItem.ClientID
                Dim data() As String = Split(itemid, "__")
 
                Dim checkBoxOpen As CheckBox = TryCast(dataItem("CBoxOpenTemplateColumn").FindControl("CBoxOpen"), CheckBox)
                AddEventCbox(checkBoxOpen, "_" & data(1) & "__" & mnid & "__Open", "CheckedChanged('" & data(1) & "','Open',this)")
 
                Dim checkBoxFull As CheckBox = TryCast(dataItem("CBoxFullTemplateColumn").FindControl("CBoxFull"), CheckBox)
                AddEventCbox(checkBoxFull, "_" & data(1) & "__" & mnid & "__Full", "CheckedChanged('" & data(1) & "','Full',this)")
 
                Dim checkBoxApproval As CheckBox = TryCast(dataItem("CBoxApprovalTemplateColumn").FindControl("CBoxApproval"), CheckBox)
                AddEventCbox(checkBoxApproval, "_" & data(1) & "__" & mnid & "__Approval", "CheckedChanged('" & data(1) & "','Approval',this)")
 
                Dim checkBoxFavorite As CheckBox = TryCast(dataItem("CBoxFavoriteTemplateColumn").FindControl("CBoxFavorite"), CheckBox)
                AddEventCbox(checkBoxFavorite, "_" & data(1) & "__" & mnid & "__Favorite", "CheckedChanged('" & data(1) & "','Favorite',this)")
 
            End If
        Next
 
        For Each nestedViewItem As GridNestedViewItem In nestedViewItems
            For Each nestedView As GridTableView In nestedViewItem.NestedTableViews
                nestedView.Style("border") = "0"
 
                Dim MyExpandCollapseButton As Button = DirectCast(nestedView.ParentItem.FindControl("MyExpandCollapseButton"), Button)
                If nestedView.Items.Count = 0 Then
                    If Not MyExpandCollapseButton Is Nothing Then
                        MyExpandCollapseButton.Style("visibility") = "hidden"
                    End If
                    nestedViewItem.Visible = False
                Else
                    If Not MyExpandCollapseButton Is Nothing Then
                        MyExpandCollapseButton.Style.Remove("visibility")
                    End If
                End If
 
                If nestedView.HasDetailTables Then
                    HideExpandColumnRecursive(nestedView)
                End If
            Next
        Next
    End Sub

Thanks in advance for your help.
Tsvetoslav
Telerik team
 answered on 17 Nov 2010
6 answers
219 views
Hi there,

I have followed the RadCompression instructions for enabling the RadSessionPageStateCompression. Everything worked like charm in Q3 2009 but it stopped in Q1 2010. I can see a huge view state in my page and I have no idea what I did wrong.

So what are the possible reason for silently not using the RadSessionPageStateCompression adapter?

Thank you in advance,
Valery.
Iana Tsolova
Telerik team
 answered on 17 Nov 2010
1 answer
119 views

The performance of the RadScheduler is simply terrible  in IE7. Has there been any recent effort to improve the performance of the RadScheduler in general and also specifically in IE7?

We have just completed a painful exercise to optimize some of our pages that use the RadScheduler at signficant expense to our organization. Unfortunately, we still have more to complete. Please let us know if you have done any work on optimizing the scheduler.

Thanks
Nikolay Tsenkov
Telerik team
 answered on 17 Nov 2010
2 answers
223 views
Hello,

I have a radwindow open.  I issue a Response.Redirect, but it navigates in the window.  I need to navigate in the whole page.  How can I do that when the rad window is open?  The request is obviously issued from the view within the radwindow?  All pages being viewed (master and in the radwindow) are within the application.

Thanks.
Georgi Tunev
Telerik team
 answered on 17 Nov 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?