Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
145 views
Hi
   If you go to sample
http://demos.telerik.com/aspnet-ajax/panelbar/examples/functionality/scrolling/defaultcs.aspx

and have a close look at panel bar text  i-e "Win Forms Controls" then you will find that it is not vertically aligned in middle.  The space left below text is more then the space available above text. My Guess is its 2 px on top and 5 px left at bottom and between that is the text.

Is there any way to align it properly ?


Best Regards
Rizwan Bashir
Alex Gyoshev
Telerik team
 answered on 21 Aug 2009
1 answer
160 views
I am trying to use the Radupload to upload files to the SQL server. The problem I am having is with the path of the file. I am using the code below. The file is trying to be located on the server instead of the client machine. How do I get the correct path so that the server can locate the file.


 

If RadUpload1.UploadedFiles.Count > 0 Then

 

 

For Each validFile As UploadedFile In RadUpload1.UploadedFiles

 

MyNcr = validFile.GetName

 

If Right(validFile.GetName, 3) = "jpg" Or Right(validFile.GetName, 3) = "JPG" Then

 

 

'validFile.SaveAs(Path.Combine("c:\", validFile.GetName()), True)

 

 

Dim fs As FileStream = New FileStream(validFile.FileName, FileMode.Open, FileAccess.Read)

 

 

Dim br As BinaryReader = New BinaryReader(fs)

 

 

photo = br.ReadBytes(System.Convert.ToInt32(fs.Length))

br.Close()

fs.Close()

 

 

 

 

Genady Sergeev
Telerik team
 answered on 21 Aug 2009
3 answers
90 views
I have a RadTreeViewContextMenu on a RadTree that contains an Item Template with a textbox. button, and customvalidator.  On Postback, I need to display the RadTreeViewContextMenu if validation fails.  I'm at a loss on how to do this.  Any ideas?

Thanks in advance,
Gene.
Veselin Vasilev
Telerik team
 answered on 21 Aug 2009
1 answer
118 views
Hi,

I want to know if it's possible to stretch a RadToolBar to fit the width of RadWindows when the one was resized? (javascript)
and how ?

Because my radwindow must be able to resizing by user, and when I resiz my window; the toolbar don't fit the new width of the window.

Thanks.
Yana
Telerik team
 answered on 21 Aug 2009
4 answers
171 views
I have a RadGrid with an inline edit form.
I have a lot of columns with display=false.
Is there an easy way to be able to expand a row to display those columns - like displaying the edit form in readonly mode?

Also the grid always renders at 100% width.
Is there a way to have the grid render at auto width?
(I currently solve this problem by nesting the grid in an empty table like this: <table><tr><td><telerik:RadGrid /></td></tr></table>, but that seems to be an 'evil hack'.)

Here's the grid:

                <telerik:RadGrid ID="UsersGrid" runat="server"
                    AllowAutomaticDeletes="True"
                    AllowAutomaticInserts="True"
                    AllowAutomaticUpdates="True"
                    AllowFilteringByColumn="true"
                    AllowPaging="True"
                    AllowSorting="True"
                    AutoGenerateColumns="False"
                    DataSourceID="UsersDataSource"
                    OnItemCommand="UsersGrid_ItemCommand"
                    PageSize="20">
                    <ValidationSettings
                        EnableValidation="true"
                        ValidationGroup="Grid" />
                    <MasterTableView
                        AllowAutomaticDeletes="true"
                        AllowAutomaticInserts="true"
                        AllowAutomaticUpdates="true"
                        CommandItemDisplay="Top"
                        DataKeyNames="UserID"
                        NoMasterRecordsText="<%$ Resources:Strings, NoData %>">
                        <CommandItemSettings
                            AddNewRecordText="<%$ Resources:Strings, Add %>"
                            RefreshText="" />
                        <EditFormSettings ColumnNumber="2">
                            <EditColumn
                                ButtonType="ImageButton"
                                CancelText="<%$ Resources:Strings, Cancel %>"
                                InsertText="<%$ Resources:Strings, Insert %>"
                                UpdateText="<%$ Resources:Strings, Update %>" />
                        </EditFormSettings>
                        <Columns>
                            <telerik:GridTemplateColumn DataField="Username" Display="false" HeaderText="<%$ Resources:Strings, Username %>">
                                <ItemTemplate>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:HiddenField ID="UserID" runat="server" Value='<%# Eval("UserID") %>' />
                                    <telerik:RadTextBox ID="Username" runat="server" Text='<%# Bind("Username") %>' ValidationGroup="Grid" />
                                    <asp:RequiredFieldValidator ID="UsernameRequired" runat="server"
                                        ControlToValidate="Username"
                                        ErrorMessage="<%$ Resources:Strings, RequiredField %>"
                                        SetFocusOnError="true"
                                        ValidationGroup="Grid" />
                                    <ajax:ValidatorCalloutExtender ID="UsernameRequiredExtender" runat="server" TargetControlID="UsernameRequired" />
                                    <asp:CustomValidator ID="UsernameValidator" runat="server"
                                        ControlToValidate="Username"
                                        ErrorMessage="<%$ Resources:Strings, UsernameTaken %>"
                                        OnServerValidate="UsernameValidator_ServerValidate"
                                        SetFocusOnError="true"
                                        ValidationGroup="Grid" />
                                    <ajax:ValidatorCalloutExtender ID="UsernameValidatorExtender" runat="server" TargetControlID="UsernameValidator" />
                               </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn Display="false" HeaderText="<%$ Resources:Strings, Password %>">
                                <ItemTemplate>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadTextBox ID="Password" runat="server" Text='<%# Bind("Password") %>' TextMode="Password" ValidationGroup="Grid" />
                                    <asp:RegularExpressionValidator ID="PasswordValidator" runat="server"
                                        ControlToValidate="Password"
                                        ErrorMessage="<%$ Resources:Strings, InvalidPassword %>"
                                        SetFocusOnError="true"
                                        ValidationExpression=".{7,}"
                                        ValidationGroup="Grid" />
                                    <ajax:ValidatorCalloutExtender ID="PasswordValidatorExtender" runat="server" TargetControlID="PasswordValidator" />
                               </EditItemTemplate>
                            </telerik:GridTemplateColumn>                                    
                            <telerik:GridTemplateColumn AutoPostBackOnFilter="true" DataField="GivenName" HeaderText="<%$ Resources:Strings, GivenName %>" SortExpression="GivenName">
                                <ItemTemplate>
                                    <asp:Label ID="GivenName" runat="server" Text='<%# Eval("GivenName") %>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                     <telerik:RadTextBox ID="GivenName" runat="server" Text='<%# Bind("GivenName") %>' ValidationGroup="Grid" />
                                    <asp:RequiredFieldValidator ID="GivenNameRequired" runat="server"
                                        ControlToValidate="GivenName"
                                        ErrorMessage="<%$ Resources:Strings, RequiredField %>"
                                        SetFocusOnError="true"
                                        ValidationGroup="Grid" />
                                    <ajax:ValidatorCalloutExtender ID="GivenNameRequiredExtender" runat="server" TargetControlID="GivenNameRequired" />
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn AutoPostBackOnFilter="true" DataField="FamilyName" HeaderText="<%$ Resources:Strings, FamilyName %>" SortExpression="FamilyName">
                                <ItemTemplate>
                                    <asp:Label ID="FamilyName" runat="server" Text='<%# Eval("FamilyName") %>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadTextBox ID="FamilyName" runat="server" Text='<%# Bind("FamilyName") %>' ValidationGroup="Grid" />
                                    <asp:RequiredFieldValidator ID="FamilyNameRequired" runat="server"
                                        ControlToValidate="FamilyName"
                                        ErrorMessage="<%$ Resources:Strings, RequiredField %>"
                                        SetFocusOnError="true"
                                        ValidationGroup="Grid" />
                                    <ajax:ValidatorCalloutExtender ID="FamilyNameRequiredExtender" runat="server" TargetControlID="FamilyNameRequired" />
                               </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn AllowFiltering="false" HeaderText="<%$ Resources:Strings, Telephone %>" SortExpression="Telephone">
                                <ItemTemplate>
                                    <asp:Label ID="Telephone" runat="server" Text='<%# Eval("Telephone") %>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <div style="white-space:nowrap;">
                                        <telerik:RadTextBox ID="Telephone" runat="server" Text='<%# Bind("Telephone") %>' MaxLength="50" ValidationGroup="Grid" />
                                        <asp:CheckBox ID="HideTelephone" runat="server" Checked='<%# Bind("HideTelephone") %>' Text="<%$ Resources:Strings, Hide %>" />
                                    </div>
                               </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn AllowFiltering="false" HeaderText="<%$ Resources:Strings, Email %>" SortExpression="Email">
                                <ItemTemplate>
                                    <asp:Label ID="Email" runat="server" Text='<%# Eval("Email") %>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <div style="white-space:nowrap;">
                                        <telerik:RadTextBox ID="Email" runat="server" Text='<%# Bind("Email") %>' MaxLength="50" ValidationGroup="Grid" />
                                        <asp:RegularExpressionValidator ID="EmailValidator" runat="server"
                                            ControlToValidate="Email"
                                            ErrorMessage="<%$ Resources:Strings, InvalidEmail %>"
                                            ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*"
                                            ValidationGroup="Grid" />
                                        <ajax:ValidatorCalloutExtender ID="EmailValidatorExtender" runat="server"
                                            TargetControlID="EmailValidator" />
                                        <asp:CheckBox ID="HideEmail" runat="server" Checked='<%# Bind("HideEmail") %>' Text="<%$ Resources:Strings, Hide %>" />
                                    </div>
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridDateTimeColumn DataField="DateOfBirth" Display="false" HeaderText="<%$ Resources:Strings, DateOfBirth %>" PickerType="DatePicker" />
                            <telerik:GridTemplateColumn Display="false" HeaderText="<%$ Resources:Strings, Height %>">
                                <ItemTemplate>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadNumericTextBox ID="Height" runat="server"
                                        DataType="Number"
                                        DbValue='<%# Bind("Height") %>'
                                        MinValue="50"
                                        MaxValue="250"
                                        NumberFormat-DecimalDigits="0"
                                        NumberFormat-GroupSizes="4" />                        
                                </EditItemTemplate>                        
                            </telerik:GridTemplateColumn>   
                            <telerik:GridTemplateColumn Display="false" HeaderText="<%$ Resources:Strings, EyeColor %>">
                                <ItemTemplate>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadComboBox ID="EyeColorID" runat="server"
                                        AppendDataBoundItems="true"
                                        DataSourceID="EyeColorDataSource"
                                        DataTextField="EyeColorName"
                                        DataValueField="EyeColorID"
                                        SelectedValue='<%# Bind("EyeColorID") %>'>
                                        <Items>
                                            <telerik:RadComboBoxItem />
                                        </Items>
                                    </telerik:RadComboBox>
                                </EditItemTemplate>                        
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn Display="false" HeaderText="<%$ Resources:Strings, HairColor %>">
                                <ItemTemplate>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadComboBox ID="HairColorID" runat="server"
                                        AppendDataBoundItems="true"
                                        DataSourceID="HairColorDataSource"
                                        DataTextField="HairColorName"
                                        DataValueField="HairColorID"
                                        SelectedValue='<%# Bind("HairColorID") %>'>
                                        <Items>
                                            <telerik:RadComboBoxItem />
                                        </Items>
                                    </telerik:RadComboBox>
                                </EditItemTemplate>                        
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn AutoPostBackOnFilter="true" DataField="GraduationYear" HeaderText="<%$ Resources:Strings, GraduationYear %>" ItemStyle-HorizontalAlign="Center" SortExpression="GraduationYear" UniqueName="GraduationYear">
                                <ItemTemplate>
                                    <asp:Label ID="GraduationYear" runat="server" Text='<%# Eval("GraduationYear") %>' Visible='<%# (int)Eval("GraduationYear") != 0 %>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadNumericTextBox ID="GraduationYear" runat="server"
                                        DataType="Number"
                                        DbValue='<%# Bind("GraduationYear") %>'
                                        MinValue='<%# DateTime.Now.Year - 10 %>'
                                        MaxValue='<%# DateTime.Now.Year + 10 %>'
                                        NumberFormat-DecimalDigits="0"
                                        NumberFormat-GroupSizes="4" />                   
                                </EditItemTemplate>                        
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn Display="false" EditFormColumnIndex="1" HeaderText="<%$ Resources:Strings, DescriptionDanish %>">
                                <ItemTemplate>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadEditor ID="DescriptionDanish" runat="server"
                                        Content='<%# Bind("DescriptionDanish") %>'
                                        SkinID="Description" />
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>                       
                            <telerik:GridTemplateColumn Display="false" EditFormColumnIndex="1" HeaderText="<%$ Resources:Strings, DescriptionEnglish %>">
                                <ItemTemplate>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadEditor ID="DescriptionEnglish" runat="server"
                                        Content='<%# Bind("DescriptionEnglish") %>'
                                        SkinID="Description" />
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>  
                            <telerik:GridTemplateColumn Display="false" HeaderText="<%$ Resources:Strings, Website %>">
                                <ItemTemplate>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadTextBox ID="Website" runat="server" Text='<%# Bind("Website") %>' ValidationGroup="Grid" />
                                    <asp:RegularExpressionValidator ID="WebsiteValidator" runat="server"
                                        ControlToValidate="Website"
                                        ErrorMessage="<%$ Resources:Strings, InvalidUri %>"
                                        ValidationExpression="http(s)?://([\w-]+\.)+[\w-]+(/[\w- ./?%&amp;=]*)?"
                                        ValidationGroup="Grid" />
                                    <ajax:ValidatorCalloutExtender ID="WebsiteValidatorExtender" runat="server"
                                        TargetControlID="WebsiteValidator" />                         
                                </EditItemTemplate>
                            </telerik:GridTemplateColumn>   
                            <telerik:GridTemplateColumn Display="false" HeaderText="<%$ Resources:Strings, Portrait %>" UniqueName="Portrait">
                                <ItemTemplate>
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <telerik:RadBinaryImage ID="Portrait" runat="server"
                                        AutoAdjustImageControlSize="false"
                                        DataValue='<%# Eval("Portrait") != DBNull.Value ? Eval("Portrait") : null %>'
                                        GenerateEmptyAlternateText="true"
                                        Width="100px" />                                
                                    <div>
                                        <asp:Button ID="DeletePortrait" runat="server"
                                            CommandArgument='<%# Eval("UserID") %>'
                                            OnClick="DeletePortrait_Click"
                                            Text="<%$ Resources:Strings, Delete %>"
                                            Visible='<%# Eval("Portrait") != DBNull.Value %>' />
                                        <ajax:ConfirmButtonExtender ID="DeletePortraitExtender" runat="server" ConfirmText="<%$ Resources:Strings, AreYouSure %>" TargetControlID="DeletePortrait" />
                                    </div>                                
                                    <asp:FileUpload ID="PortraitUpload" runat="server" />
                                </EditItemTemplate>                        
                            </telerik:GridTemplateColumn>    
                            <telerik:GridCheckBoxColumn AutoPostBackOnFilter="true" DataField="Administrator" HeaderText="<%$ Resources:Strings, Administrator %>" ItemStyle-HorizontalAlign="Center" SortExpression="Administrator" />
                            <telerik:GridCheckBoxColumn AutoPostBackOnFilter="true" DataField="TeachingStaff" HeaderText="<%$ Resources:Strings, TeachingStaff %>" ItemStyle-HorizontalAlign="Center" SortExpression="TeachingStaff" />
                            <telerik:GridCheckBoxColumn AutoPostBackOnFilter="true" DataField="Student" HeaderText="<%$ Resources:Strings, Student %>" ItemStyle-HorizontalAlign="Center" SortExpression="Student" />
                            <telerik:GridCheckBoxColumn AutoPostBackOnFilter="true" DataField="Alumnus" HeaderText="<%$ Resources:Strings, Alumnus %>" ItemStyle-HorizontalAlign="Center" SortExpression="Alumnus" />
                            <telerik:GridCheckBoxColumn AutoPostBackOnFilter="true" DataField="Applicant" HeaderText="<%$ Resources:Strings, Applicant %>" ItemStyle-HorizontalAlign="Center" SortExpression="Applicant" />
                            <telerik:GridTemplateColumn AllowFiltering="false" HeaderStyle-Width="40px" ItemStyle-HorizontalAlign="Center">
                                <ItemTemplate>
                                    <asp:ImageButton ID="Unlock" runat="server"    
                                        AlternateText="<%$ Resources:Strings, Unlock %>"
                                        CommandArgument='<%# Eval("UserID") %>'
                                        ImageUrl="~/images/lock.gif"
                                        OnClick="Unlock_Click"
                                        ToolTip="<%$ Resources:Strings, Unlock %>"
                                        Visible='<%# Eval("IsLockedOut") %>' />
                                    <ajax:ConfirmButtonExtender ID="UnlockExtender" runat="server" ConfirmText="<%$ Resources:Strings, AreYouSure %>" TargetControlID="Unlock" />
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn AllowFiltering="false" HeaderStyle-Width="40px" ItemStyle-HorizontalAlign="Center">
                                <ItemTemplate>
                                    <asp:ImageButton ID="Edit" runat="server"
                                        AlternateText="<%$ Resources:Strings, Edit %>"
                                        CommandName="Edit"
                                        ImageUrl="~/images/edit.gif"
                                        ToolTip="<%$ Resources:Strings, Edit %>" />
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>
                            <telerik:GridTemplateColumn AllowFiltering="false" HeaderStyle-Width="40px" ItemStyle-HorizontalAlign="Center">
                                <ItemTemplate>                                           
                                    <asp:ImageButton ID="Delete" runat="server"
                                        AlternateText="<%$ Resources:Strings, Delete %>"
                                        CommandName="Delete"
                                        ImageUrl="~/images/delete.gif"
                                        ToolTip="<%$ Resources:Strings, Delete %>" />
                                    <ajax:ConfirmButtonExtender ID="DeleteExtender" runat="server" TargetControlID="Delete" ConfirmText="<%$ Resources:Strings, AreYouSure %>" />
                                </ItemTemplate>
                            </telerik:GridTemplateColumn>                                   
                        </Columns>
                    </MasterTableView>
                </telerik:RadGrid>
ondfisk
Top achievements
Rank 2
 answered on 21 Aug 2009
2 answers
74 views
Hi,

using the latest RadToolBar, I could not find a way or an example demonstrating how to have a HoveredImageUrl different for a checked button than for an unchecked button. Basically what I would have expected is a "CheckedHoveredImageUrl" property.

Is there any easy way to have that behavior on the toolbar buttons?

ps: I'm not going server-side on button clicks, only some js gets executed.

Thanks
Nicolas
Top achievements
Rank 1
 answered on 21 Aug 2009
1 answer
123 views
Hi Support

I have a page setup with a floating catalog dock zone like this

<asp:Panel ID="panFloat" runat="server" width="180px" style="z-index:1;background-image:url('../../../pixx/vistaBGPanel.jpg');background-repeat:repeat;padding:0px;border:0px;">   
<asp:UpdatePanel ID="updOptions" runat="server" UpdateMode="Conditional">    
                    <ContentTemplate>
<div style="position:relative">
<telerik:RadSplitter id="MainSplitter"  runat="server" Width="180px" Height="450px" Orientation="Horizontal" Skin="Vista" >
                        <telerik:RadPane id="main"  runat="server" height="100%" Width="100%">                            
                            <telerik:RadPanelBar runat="server" ID="RadPanelBar1" Height="100%" Width="100%" ExpandMode="SingleExpandedItem" Skin="Vista" BackColor="Transparent" >
                            <Items>
                                <telerik:RadPanelItem Text="Component ToolBox" Expanded="true">
                                <Items><telerik:RadPanelItem><ItemTemplate>
                                    <telerik:raddocklayout id="RadDockLayout_Catalog" runat="server" Skin="Vista">
                                        <telerik:raddockzone id="zoneCatalog" runat="server" Skin="Vista" Orientation="Vertical" Height="368px">
</Items>
                            </telerik:RadPanelBar>
                                                    
                        </telerik:RadPane>     
                    </telerik:RadSplitter>
</ContentTemplate>
</asp:UpdatePanel>
</asp:Panel>
    <ajaxToolkit:AlwaysVisibleControlExtender
        HorizontalSide="Left"  
        VerticalSide="Top"
        EnableViewState="true"
        TargetControlID="panFloat"
        BehaviorID="panFloater"
        runat="server"/>

which floats to the left of a set of dock zones that fill the page defined like this

<telerik:raddocklayout id="RadDockLayout_Page" runat="server" Skin="Vista">
<telerik:raddockzone id="zoneTop" runat="server" Skin="Vista" >
                    <telerik:raddock runat="server" ID="default_Menu" Skin="Vista" BackColor="Transparent" Title="Menu" OnClientDragStart="OnClientDragStart" OnClientDragEnd="OnClientDragEnd" DefaultCommands="None">
                    <ContentTemplate>
                        <hpartsMASTER:Menu ID="defpart_Menu" title="Menu Block" runat="server"/>
                    </ContentTemplate>
                    </telerik:raddock>
                </telerik:raddockzone> </telerik:raddocklayout>

my problem is that when a dock is dragged into the floating catalog, if a zone is beneath the catalog the zone beneath will get the dock rather than the catalog upon drop, in spite of the catalog zone being highlighted on drag and not the one beneath.

any ideaz, using firefox, Q12009 release

thanks
Rob

</ContentTemplate>




Pero
Telerik team
 answered on 21 Aug 2009
2 answers
92 views
I have a RadGrid with a DetailTable that throws an error on export to pdf in IE7 and earlier.  Export works fine in IE8, Firefox, and Chrome, but throws the following error in IE7 and earlier:
    System.SystemException: At least one of minimum, optimum, or maximum IPD must be specified on table.

Here is the source code for the RadGrid
<telerik:RadGrid ID="rgrdPayroll" runat="server" AutoGenerateColumns="False" DataSourceID="odsPersonnelByPI" 
    GridLines="None"
    <MasterTableView DataSourceID="odsPersonnelByPI" DataKeyNames="DisplayName" HierarchyLoadMode="ServerBind"
        <DetailTables> 
            <telerik:GridTableView runat="server" DataSourceID="odsPayrollByPI" GridLines="None"
                <ParentTableRelation> 
                    <telerik:GridRelationFields DetailKeyField="DisplayName" MasterKeyField="DisplayName" /> 
                </ParentTableRelation> 
                <Columns> 
                    <telerik:GridBoundColumn DataField="SlAcct6No" HeaderText="Account" UniqueName="SlAcct6No"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="AcctName" HeaderText="Account Name" UniqueName="AcctName"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="Pay" DataType="System.Decimal" HeaderText="Pay" 
                        ReadOnly="True" SortExpression="Pay" UniqueName="Pay" DataFormatString="{0:$#,#.#0;-$#,#.#0;$0.00}"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="Benfit" DataType="System.Decimal" HeaderText="Benefit" 
                        ReadOnly="True" SortExpression="Benfit" UniqueName="Benfit" DataFormatString="{0:$#,#.#0;-$#,#.#0;$0.00}"
                    </telerik:GridBoundColumn> 
                    <telerik:GridBoundColumn DataField="Total" DataType="System.Decimal" HeaderText="Total" 
                        ReadOnly="True" SortExpression="Total" UniqueName="Total" DataFormatString="{0:$#,#.#0;-$#,#.#0;$0.00}"
                    </telerik:GridBoundColumn> 
                </Columns> 
            </telerik:GridTableView> 
        </DetailTables> 
        <ExpandCollapseColumn Visible="True"
        </ExpandCollapseColumn> 
        <Columns> 
            <telerik:GridBoundColumn DataField="DisplayName" HeaderText="Personnel" SortExpression="DisplayName" 
                UniqueName="DisplayName"
            </telerik:GridBoundColumn> 
            <telerik:GridBoundColumn DataField="Total" DataType="System.Decimal" HeaderText="Total" 
                ReadOnly="True" SortExpression="Total" UniqueName="Total Salary" DataFormatString="{0:$#,#.#0;-$#,#.#0;$0.00}"
            </telerik:GridBoundColumn> 
        </Columns> 
    </MasterTableView> 
</telerik:RadGrid> 

And here is the C# code that runs when the export button is clicked:

protected void btnPDFPersonnel_Click(object sender, EventArgs e) 
    rgrdPayroll.ExportSettings.FileName = ddlPIs.SelectedValue.Substring(0, ddlPIs.SelectedValue.IndexOf(',')) + "_Personnel"
    rgrdPayroll.ExportSettings.OpenInNewWindow = true
    rgrdPayroll.ExportSettings.ExportOnlyData = true
    rgrdPayroll.ExportSettings.IgnorePaging = false
    rgrdPayroll.ExportSettings.Pdf.PageWidth = Unit.Parse("297mm"); 
    rgrdPayroll.ExportSettings.Pdf.PageHeight = Unit.Parse("216mm"); 
    foreach (GridItem item in rgrdPayroll.MasterTableView.Items) 
    { 
        item.Expanded = true
    } 
    rgrdPayroll.MasterTableView.ExportToPdf(); 
 
 

Has anybody run across this error before in IE7?  Why would this same code work in the other browsers by not IE7?

Thanks,

Brian

Brian Furner
Top achievements
Rank 2
 answered on 21 Aug 2009
3 answers
501 views

For a project I'm working on, we're looking for a way to dynamically add filters to a page which then control the dataoutput in a RadGrid. We want to add the filters dynamically because we want the customer to be able to change which properties can be filtered and what filtertype (textbox, dropdown, colourpicker, etc.) should be used.

The filter should work as follows:

  • The customer links a filter to a certain property and specifies the filtertype (for this example: dropdown). This is specified in a database table.

  • A user control which contains all the filter loads all filters specified, this is done dynamically according to the database table
  • The filters load all values of the specified property as options. The first time the page loads; this would be the (disctinct) values of all items. 
  • Now the user selects a value from one of the filters; the page reloads 
  • Only items which have the specified filter value are retrieved, the user may specify one or more filters at the same time. 
  • Once a user drills down by filtering, only filtervalues of the retrieved items should be used in the other filters to hide values which aren't present in the resulting list of items; so all other filters have to be rebound according to the new query.

 

I have the following problems:

  • When I create the filters runtime, events are lost because the controls get recreated each postback. 

  • I could place the filters in PreInit which should solve this, but then determining which controls should be loaded becomes a problem since loading all environment vars isn't finished yet?
  • I don't know a good way of returning all the filter values to a central point from which I can make a good query. 
  • The query has to be dynamic. I'm using linq which I want to make dynamic so I don't have to select everything everytime. How to make a dynamic select query based on a string stored in the database? 
  • I have to select items based on the filtervalues and then adjust the rest of the filters to the already made selection. That kind of messes up the whole regular databinding sequence.

Any help in one of the above would be great!

PS: One thing I thought about was passing along filter values in the postback which would have to be recognizable. That way the server could use them for selection and then create the filters and autoselect the previously selected filtervalues. I'm not quite sure how to acheive this though...

Daniel
Telerik team
 answered on 21 Aug 2009
3 answers
144 views
We have a fairly simple radEditor, and in firefox, it's fine:  when we bold something, its bold.  When we double-click on something previously bolded, the bold icon is highlighted, and the same for the rest of the style-changing icons (italics, underline, paragraph alignment, etc - literally ALL of them).

However, in IE8, nothing.  If we change the font, the font will change in the editor window, but that's it:  bold, italics, alignment, underline, nothing that changes the actual _appearance_ of the font in the editor window.  When you look at the HTML code, the tags are there, but in design and preview mode, its just plain text.

When I turn compatability mode on in IE8, BOOM!  The editor doesn't work at ALL (I can include a screenshot if asked - just a jumble of broken images and unrecognizable junk). 

So, in FF, we're fine, in IE8, we dead.  Any thoughts would be much appreciated.

Rumen
Telerik team
 answered on 21 Aug 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?