Telerik Forums
UI for ASP.NET AJAX Forum
4 answers
167 views
I have two panes separated by a splitbar.  When the user resizes or expands/collpases the splitbar, I'm saving the width of both panes in a cookie.  When the user returns to the page, I'm extracting the cookie information and setting the widths of each pane.  If either one of the widths returned from the cookie is '0', I set the corresponding pane to Collapse() and the other one to Expand().  

function OnClientLoadedHandler(splitter, args)

{

var leftWidthCookie = getCookie('leftPaneWidth');

var rightWidthCookie = getCookie('rightPaneWidth');

if (leftWidthCookie != null && rightWidthCookie != null)

{

var leftPane = splitter.getPaneById('<%= LeftPane.ClientID %>');

var rightPane = splitter.getPaneById('<%= RightPane.ClientID %>');

if (leftWidthCookie == '0')

{

leftPane.Collapse();

rightPane.Expand();

}

else if (rightWidthCookie == '0')

{

rightPane.Collpase();

leftPane.Expand();

}

else

{

leftPane.set_width(leftWidthCookie);

rightPane.set_width(rightWidthCookie);

}

}

}


The issue is that the user can't expand the collapsed pane, clicking on the arrow does nothing.  Does something else need to be set?  Ideally, I would like the splitbar to go to 50% width of the radSplitter so the user can then resize manually or be able to expand or collapse either pane.

Thanks!
Juan_Massyn
Top achievements
Rank 1
 answered on 12 Nov 2008
4 answers
128 views
Dear All,

I am using the Rad Grid for AJAX. 

In that I have bounded the selected index change event, but it is not firing.

My designer code is:

    <telerik:RadGrid ID="RadGrid1" runat="server" AllowPaging="True" AllowSorting="True"
        Skin="Office2007" AutoGenerateColumns="false" GroupingEnabled="False" PageSize="5"
        ShowStatusBar="True" AllowMultiRowSelection="true">
        <PagerStyle Mode="Slider" />
        <MasterTableView NoDetailRecordsText="No Versions Found." NoMasterRecordsText="No Documents Found."
            HierarchyLoadMode="Client">
            <RowIndicatorColumn>
                <HeaderStyle Width="20px" />
            </RowIndicatorColumn>
            <ExpandCollapseColumn>
                <HeaderStyle Width="20px" />
            </ExpandCollapseColumn>
        </MasterTableView>
        <ClientSettings AllowDragToGroup="True" AllowColumnHide="True" AllowColumnsReorder="True"
            ReorderColumnsOnClient="True">
            <Selecting AllowRowSelect="True" />
            <Resizing AllowColumnResize="True" />
        </ClientSettings>
        <FilterMenu EnableTheming="True" Skin="Office2007">
            <CollapseAnimation Duration="200" Type="OutQuint" />
        </FilterMenu>


Can any one help me in this regard?

Thanks a lot in advance.
Shinu
Top achievements
Rank 2
 answered on 12 Nov 2008
2 answers
264 views
Hi,

I am using a RadGrid control within a Sharepoint webpart. The width of the grid is set to 100% of the web part. The width of each column is set to a fixed percentage so that they all add up to 100%. Is is possible that columns could have a minimum size so that grids do not shrink smaller than a predefined size.  Also is it possible that the columns be allowed to grow and shrink depending on the webpart zone that they are in?

Thanks
Vedanshu
Neda
Top achievements
Rank 1
 answered on 12 Nov 2008
1 answer
120 views
In my grid I have a drop down column

<telerik:GridDropDownColumn UniqueName="ddlArtistType" DataField="ArtistType" ListTextField="ArtistType" ListValueField="ArtistType" 
                                        ListDataMember="ArtistType" HeaderText="Artist Type" DropDownControlType="RadComboBox" /> 



When I run the page and add a new row, the items in the drop down list selection are taken from the underlying grid datasource not its own separate datasource (so many items in the dropdown are dupliacted)

I need to assign a totally separate datasource in order to pick one of the items to enter into the underlying column in the grid

Using the above method doesnt seem to make sense since when would you ever use the grid as a datasource for the dropdown, they are usually a totally different dataset

Ive tried this
<telerik:GridDropDownColumn UniqueName="ddlArtistType" DataField="ArtistType" HeaderText="Artist Type" DropDownControlType="RadComboBox" /> 



 and trying to populate in the ItemDataBound event, but the row always shows up empty

So how can I use a GridDropDownColumn and assign its own datasource at runtime in my code behind ?

** Im not using a datatable as the grid datasource, im using a custom collection so ListDatamember would have no effect
Princy
Top achievements
Rank 2
 answered on 12 Nov 2008
2 answers
153 views
Hi Guys,
               I have a scenario where I want to show a set of questions in which each questions is of different type say Single selection (radio btn),Multiple choice (chkbox), Text, Ranking etc. I want to show them in a single page and collect the information in onclick. Can some one suggest me best possible control or way of doing this?

Things that I have tried

1) In RadGrid with one colum and having diffenrent type of UI in panels  inside Templatecolum. And manipulating the visibility of the each panel in ItemCreated and ItemBound events for different type of questions coming from the data. That is my gird in aspx look like this
              

 

<MasterTableView Width="70%" AutoGenerateColumns="False" NoMasterRecordsText="No Product Exists">

 

 

<Columns>

 

 

    <telerik:GridTemplateColumn UniqueName="Question">

 

 

        <ItemTemplate>

 

 

                <asp:Panel ID="pnlSimpleTxt" runat="server" BackColor="Aqua" Height="50px" Width="125px">

 

 

                        <asp:Literal ID="Question1" runat="server"></asp:Literal>

 

 

                        <asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>

 

 

                </asp:Panel>

 

 

               <asp:Panel ID="pnlMultiChoice" runat="server" BackColor="Bisque" Height="50px" Width="125px">

 

 

                        <asp:Literal ID="Question2" runat="server"></asp:Literal>

 

 

                        <asp:CheckBox ID="CheckBox1" runat="server" />
                        <asp:CheckBox ID="CheckBox2" runat="server" />

 

 

                </asp:Panel>

 

 

                <asp:Panel ID="pnlSingleSelect" runat="server" Height="50px" Width="125px">

 

 

                        <asp:Literal ID="Question3" runat="server"></asp:Literal>

 

 

                        <asp:DropDownList ID="ddlAnswerOptions" runat="server">

 

 

                        </asp:DropDownList>

 

 

                </asp:Panel>

 

 

        </ItemTemplate>

 

 

</telerik:GridTemplateColumn>

 

 

</Columns>

 

 

</MasterTableView>

 

Though it is working, I am not ok with this crude way of doing it.  Is there any other good solution for this?

Thanks for you help !!
ms

ms
Top achievements
Rank 1
 answered on 12 Nov 2008
3 answers
101 views
I have a situation where I'd like to display, in the exported Excel spreadsheet, several columns which have a style of "display:none". Is this possible and how would one go about this?

example:

 

<telerik:GridBoundColumn DataField="acct_first_name" HeaderText="First Name" Display="false" UniqueName="acct_first_name" />

Or, how would I display each data item in a GridTemplateColumn as a separate cell in Excel once it's exported?
example:
<telerik:GridTemplateColumn UniqueName="Acct_full_address"><HeaderTemplate>
<div id="Div2" runat="server"> Full Address</div>
</HeaderTemplate>
<ItemTemplate>
<div>

<%# Eval("acct_first_name") %><%# Eval("acct_last_name") %>

</div>
<div>
<%# Eval("acct_addr1") %><%# Eval("acct_addr2") %><%# Eval("acct_unit_number") %>

</div>
<div>
<% # Eval("acct_city") %>,<% # Eval("acct_state") %> <%# Eval("acct_postalcode") %><%# Eval("acct_country_code") %>

</div>
</ItemTemplate>
</telerik:GridTemplateColumn>

 

Any help would be much appreciated.

 

Shinu
Top achievements
Rank 2
 answered on 12 Nov 2008
3 answers
152 views
I have a Grid that allows users to enter numbers in all the rows and displays the totals at the bottom. To achieve this I used a GridTemplateColumn with RadNumericTextBox textbox in it. It itemtemplate is shown below 
<ItemTemplate>
            <telerik:RadNumericTextBox ID="Number" runat="server" MinValue="0" MaxValue="1800000000" NumberFormat-AllowRounding="true" Width="90px" NumberFormat-DecimalDigits="0" Skin="Office2007" OnTextChanged="Number_TextChanged" AutoPostBack="true"></telerik:RadNumericTextBox>
</ItemTemplate>

On the textchanged event I loop through all the rows and calculate the total at follows

foreach (GridDataItem gr in radGrid1.MasterTableView.Items)
            {
                RadNumericTextBox Number = (RadNumericTextBox)gr.FindControl("Number");
                lTotal += long.Parse(Math.Round(Number.Value.Value, 0).ToString());
            }

and then I display it in the footer as follows:

radGrid1.MasterTableView.Columns[8].FooterText = string.Format("{0:0,000}",lTotal );

This does not update the footer text. Please help.


Shinu
Top achievements
Rank 2
 answered on 12 Nov 2008
5 answers
415 views
I am trying to export my grid using LinkButton's in the CommandItemTemplate, but unfortunately it is not working.  I have tried setting the OnClick="LinkButton1_Click" but it does not seem to be working.

I have also tried to FindControl during the RadGrid1_ItemCreated event, but then I cannot set the OnClick property from there since it is Protected...

Any suggestions would be great
    Protected Sub LinkButton1_Click(ByVal sender As ObjectByVal e As System.EventArgs)  
        RadGrid1.ExportSettings.ExportOnlyData = True 
        RadGrid1.MasterTableView.ExportToExcel()  
    End Sub 
 
    Protected Sub LinkButton2_Click(ByVal sender As ObjectByVal e As System.EventArgs)  
        RadGrid1.MasterTableView.ExportToPdf()  
    End Sub 
 
    Protected Sub RadGrid1_ItemCreated(ByVal sender As ObjectByVal e As Telerik.Web.UI.GridItemEventArgs) Handles RadGrid1.ItemCreated  
        If (TypeOf e.Item Is GridCommandItem) Then 
            Dim cmditm As GridCommandItem = DirectCast(e.Item, GridCommandItem)  
            Dim LinkButton1 As LinkButton = DirectCast(cmditm.FindControl("LinkButton1"), LinkButton)  
            Dim LinkButton2 As LinkButton = DirectCast(cmditm.FindControl("LinkButton2"), LinkButton)  
 
            LinkButton1.OnClick = LinkButton1_Click()  
        End If 
    End Sub 

<div class="panelbody_bottom">  
    <div style="height: 20px;">&nbsp;</div> 
    <telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false" Skin="Telerik" AllowAutomaticDeletes="false" AllowAutomaticUpdates="false" AllowAutomaticInserts="false" AllowSorting="true" AllowPaging="true">  
        <ExportSettings IgnorePaging="true" OpenInNewWindow="true" ExportOnlyData="true">  
            <Excel Format="HTML" /> 
            <Pdf AllowAdd="false" AllowCopy="true" AllowModify="true" AllowPrinting="true" Author="Anonymous" Keywords="None" PageBottomMargin="1in" PageLeftMargin="1in" PageRightMargin="1in" PageTopMargin="1in" PageTitle="My Businesses For Sale" 
                Subject="My Businesses For Sale" Title="My Businesses For Sale" PaperSize="Letter" /> 
        </ExportSettings> 
        <MasterTableView TableLayout="Auto" DataKeyNames="ID" CommandItemDisplay="Top">  
            <PagerStyle AlwaysVisible="true" Mode="NextPrevAndNumeric" /> 
            <RowIndicatorColumn> 
                <HeaderStyle Width="15px" /> 
            </RowIndicatorColumn> 
            <ExpandCollapseColumn> 
                <HeaderStyle Width="15px" /> 
            </ExpandCollapseColumn> 
            <Columns> 
                <telerik:GridBoundColumn DataField="_31" HeaderText="Broker/Agent" UniqueName="31" /> 
                <telerik:GridBoundColumn DataField="_45" HeaderText="Business Extension" UniqueName="45" /> 
                <telerik:GridBoundColumn DataField="_59" HeaderText="Description" UniqueName="59" /> 
                <telerik:GridBoundColumn DataField="_118" HeaderText="Selling Price" UniqueName="_118" DataFormatString="{0:c}" /> 
                <telerik:GridTemplateColumn DataField="DateExpires" HeaderText="Expires" UniqueName="DateExpires">  
                    <ItemTemplate> 
                        <asp:Label ID="lblDateUpdated" runat="server" Text='<%# FormatDate(DataBinder.Eval(Container.DataItem, "DateExpires"), DataBinder.Eval(Container.DataItem, "OrderID")) %>' /> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
                <telerik:GridBoundColumn DataField="AdHits" HeaderText="Views" ItemStyle-HorizontalAlign="Center" HeaderStyle-HorizontalAlign="Center" UniqueName="AdHits" /> 
                <telerik:GridTemplateColumn DataField="ID" HeaderText="" UniqueName="Edit">  
                    <ItemTemplate> 
                        <href='#'>edit</a> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
                <telerik:GridTemplateColumn DataField="ID" HeaderText="" UniqueName="Sold">  
                    <ItemTemplate> 
                        <href='#'>sold</a> 
                    </ItemTemplate> 
                </telerik:GridTemplateColumn> 
            </Columns> 
            <CommandItemTemplate> 
                <div style="float: left; display: inline; padding-left: 5px;"><href="PostAd.aspx">post new business for sale ad</a></div>  
    <div style="float: right; display: inline; padding-right: 5px;">  
        <asp:LinkButton ID="LinkButton1" runat="server" Text="export to excel" /> 
        &nbsp;|&nbsp;  
        <asp:LinkButton ID="LinkButton2" runat="server" Text="export to pdf" /> 
    </div> 
            </CommandItemTemplate> 
        </MasterTableView> 
        <StatusBarSettings LoadingText="Loading..." /> 
    </telerik:RadGrid> 
</div> 
Chase Florell
Top achievements
Rank 1
 answered on 12 Nov 2008
9 answers
487 views
Hi Guys,

How can use RadStyleSheetManager with my own stylesheets. I mean, I want to use the RadStyleSheetManager feature to gzip and combine my own stylesheet.

Thanks!

Shane
Shane
Top achievements
Rank 1
 answered on 11 Nov 2008
6 answers
162 views
I posted a message asking where the 'my posts' section of the forums were, you replied (by email) asking me to look at the attached screenshot.  Because I dont know where my posts are I cant look at the attached screenshot to see where my posts are !
Levi
Top achievements
Rank 1
 answered on 11 Nov 2008
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?