Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
116 views
Hi All,
I am developing product using asp.net c sharp.I have method name is public List<Role> GetRoles(int UserId) and this method return list of Roles which is assigned user. I need to write or create xml file for user Roles to build menu control from xml file.

That means,
1.How to write list of Roles in xml file from returning list of Roles by this method?
2.How to build menu control from xml file?

Thanks in Advance...!
Peter
Telerik team
 answered on 02 Aug 2012
1 answer
174 views

Grid is displaying an empty column and row. I have tried setting the width of the grid to exactly the width of the column widths combined, however, this results in a horizontal scroll which is not desired unless the columns get resized. In addition, even when I made the grid exactly the size of the column widths combined the empty column and row still appeared. The only column sizing I do in the C# code behind is to set the filter text box size (which is 25px less than the column width).

 

protected void RadGridAggressiveMatches_ItemCreated(object sender, GridItemEventArgs e)

{

if (e.Item is GridFilteringItem)

{

GridFilteringItem filteringItem = e.Item as GridFilteringItem;

 //set dimensions for the filter textbox
TextBox box = filteringItem["Column1"].Controls[0] as TextBox;
box.Width = Unit.Pixel(50);

box = filteringItem["Column2"].Controls[0] as TextBox

box.Width = Unit.Pixel(50);

box = filteringItem["Column3"].Controls[0] as TextBox;

box.Width = Unit.Pixel(175);

box = filteringItem["Column4"].Controls[0] as TextBox;

box.Width = Unit.Pixel(175);

box = filteringItem["Column5"].Controls[0] as TextBox;

box.Width = Unit.Pixel(175);

box = filteringItem["Column6"].Controls[0] as TextBox;

box.Width = Unit.Pixel(175);

box = filteringItem["Column7"].Controls[0] as TextBox;

box.Width = Unit.Pixel(15);

box = filteringItem["Column8"].Controls[0] as TextBox;

box.Width = Unit.Pixel(45);

}

}

 
<telerik:RadGrid ID="RadGridAggressiveMatches" runat="server" Width="1100px" Height="250px" DataMember="Aggressive Members"

 GridLines="None"

 AllowSorting="True"

 ShowFooter="True"

 Skin="Office2007"

 AutoGenerateColumns="False"

 AllowFilteringByColumn="True"

 onitemcreated="RadGridAggressiveMatches_ItemCreated"

 onselectedindexchanged="RadGridAggressiveMatches_SelectedIndexChanged"

 onsortcommand="RadGridAggressiveMatches_SortCommand"

 onneeddatasource="RadGridAggressiveMatches_NeedDataSource" >

 <ClientSettings AllowColumnsReorder="True" ReorderColumnsOnClient="True" EnablePostBackOnRowClick="true">

 <Selecting AllowRowSelect="True" />  

 <Scrolling AllowScroll="true" />

 <Resizing AllowColumnResize="true" AllowRowResize="true" ResizeGridOnColumnResize="false" />

 </ClientSettings>

 <MasterTableView TableLayout="Fixed" AllowFilteringByColumn="true" >

 <Columns>

 <telerik:GridBoundColumn UniqueName="Column1" DataField="Column1" HeaderText="Column 1" DataType="System.Int32"

 SortExpression="Column1" AllowFiltering="true" AutoPostBackOnFilter="false">

 <HeaderStyle Width="75px" />

 <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"

 Font-Strikeout="False" Font-Underline="False" Wrap="False" />

 </telerik:GridBoundColumn>

 <telerik:GridBoundColumn UniqueName="Column2" DataField="Column2" HeaderText="Column 2" DataType="System.Int32" SortExpression="Column2">
<HeaderStyle Width="75px" />
<ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"

 Font-Strikeout="False" Font-Underline="False" Wrap="False" />

 </telerik:GridBoundColumn>

 <telerik:GridBoundColumn UniqueName="Column3" DataField="Column3" HeaderText="Column 3" DataType="System.String"

 SortExpression="Column3">

 <HeaderStyle Width="200px" />

 <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"

 Font-Strikeout="False" Font-Underline="False" Wrap="False" />

 </telerik:GridBoundColumn>

 <telerik:GridBoundColumn UniqueName="Column4" DataField="Column4" HeaderText="Column 4" DataType="System.String"

 SortExpression="Column4">

 <HeaderStyle Width="200px" />

 <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"

 Font-Strikeout="False" Font-Underline="False" Wrap="False" />

 </telerik:GridBoundColumn>

 <telerik:GridBoundColumn UniqueName="Column5" DataField="Column5" HeaderText="Column 5" DataType="System.String" SortExpression="Column5">

 <HeaderStyle Width="200px" />

 <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"

 Font-Strikeout="False" Font-Underline="False" Wrap="False" />

 </telerik:GridBoundColumn>

 <telerik:GridBoundColumn UniqueName="Column6" DataField="Column6" HeaderText="Column 6" DataType="System.String" SortExpression="Column6">

 <HeaderStyle Width="200px" />

 <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"

 Font-Strikeout="False" Font-Underline="False" Wrap="False" />

 </telerik:GridBoundColumn>

 <telerik:GridBoundColumn UniqueName="Column7" DataField="Column7" HeaderText="Col 7" DataType="System.Int32" SortExpression="Column7">

 <HeaderStyle Width="40px" />

 <ItemStyle Font-Bold="False" Font-Italic="False" Font-Overline="False"

 Font-Strikeout="False" Font-Underline="False" Wrap="False" />

 </telerik:GridBoundColumn>

 <telerik:GridTemplateColumn UniqueName="Column8" HeaderText="Column 8" SortExpression="Column8">

 <HeaderStyle Width="70px" />

 <ItemTemplate>

 <asp:RadioButtonList ID="RadionButtonListDecision" runat="server" RepeatDirection="Vertical">

 <asp:ListItem Value="1" Text="Yes"></asp:ListItem>

 <asp:ListItem Value="2" Text="No"></asp:ListItem>

 </asp:RadioButtonList>

 </ItemTemplate>

 </telerik:GridTemplateColumn>

 </Columns>

 </MasterTableView>

 <FilterMenu Skin="Office2007" EnableTheming="True">

 <CollapseAnimation Type="OutQuint" Duration="200"></CollapseAnimation>

 </FilterMenu>

 </telerik:RadGrid>

How do I get rid of the empty column and row?

Tsvetina
Telerik team
 answered on 02 Aug 2012
6 answers
72 views
I have scheduler with many resource types and custom attributes in an advanced insert template. It seems to work well creating one. When I try the recurrence it still only creates one... no errors just does not do more than one.... is there anything special for the resource types or custom attributed needed?
Peter
Telerik team
 answered on 02 Aug 2012
2 answers
103 views
Hello.

I am a complete newbie using rad controls, and I am playing around with the captcha.
I can see in the documentation that I should be able to set the Font Warp to different levels, but I cannot find this property.
I have looked in the UI property pane.

Can you point me in the right direction?

best regards
Agge
Agge
Top achievements
Rank 1
 answered on 02 Aug 2012
4 answers
465 views
im wanting to open a radwindow from a hyperlink in a grid. the window provides a way to update the row item, so populates a form within a window with the existing field values.

previously it was being done on rowclick so just worked with loading the fields from the GridDataItem and opening the window via

Me.pBlocks.VisibleOnPageLoad = True


this now needs to be done via a hyperlink on one of the columns.

the hyperlink column is added in the code behind

hlc =

 

New GridHyperLinkColumn

 

Me.uxBlocks.Columns.Add(hlc)

hlc.HeaderText = GetCaption(p.Name)

hlc.UniqueName = p.Name

hlc.DataTextField = p.Name

hlc.DataNavigateUrlFields = {p.Name}

hlc.DataNavigateUrlFormatString =

 

"linktowindow?q={0}"

hlc.Display = True

 

hlc.HeaderStyle.Width =

 

 

Unit.Pixel(170)

hlc.ItemStyle.Wrap =

 

True


could i still call the existing method by getting the GridDataItem when the link is clicked?

Mark
Top achievements
Rank 1
 answered on 02 Aug 2012
7 answers
393 views
I can't seem to figure out how to get the selected value or text from a RadComboBox in a GridTemplateColumn. Actually seems like I can't find the control at all.  The edit Form is a popup. The grid is in a user control. 

Here is my column 
<telerik:GridTemplateColumn UniqueName="ProdWorkstation" HeaderText="ProdWorkstation">
    <ItemTemplate>
    <%#DataBinder.Eval(Container.DataItem, "ProdWorkstation")%>
    </ItemTemplate>
    <EditItemTemplate>
        <telerik:RadComboBox runat="server" ID="RadComboBox_SelectWorkStation" Height="300px" Width="750px" DataSourceID="LCM_UserWorkstationList" EnableLoadOnDemand="true"
        ItemsPerRequest="20" EnableAutomaticLoadOnDemand="False" DataTextField="Workstation" DataValueField="Workstation"
        style="margin-bottom: 0px" AutoPostBack="True" HighlightTemplatedItems="true" CausesValidation="False" Skin="Office2007"
         OnItemsRequested="RadComboBox1_ItemsRequested">
 
            <HeaderTemplate>
                <ul>
                    <li class="col75">user_id</li>
                    <li class="col200">Workstation</li>
                    <li class="col200">Name</li>
                    <li class="col200">Profile</li>
                </ul>
            </HeaderTemplate>
            <ItemTemplate>
                <ul>
                    <li class="col75"><%# DataBinder.Eval(Container.DataItem, "user_id")%></li>
                    <li class="col200"><%# DataBinder.Eval(Container.DataItem, "Workstation")%></li>
                    <li class="col200"><%# DataBinder.Eval(Container.DataItem, "Name") %></li>
                    <li class="col200"><%# DataBinder.Eval(Container.DataItem, "Profile")%></li>
                </ul>
            </ItemTemplate>
        </telerik:RadComboBox>
    </EditItemTemplate>
</telerik:GridTemplateColumn>

Here is the codebehind where I try and get the text:
if (e.CommandName == "PerformInsert")
            {
                GridEditFormInsertItem EditForm = (GridEditFormInsertItem)e.Item;
                RadComboBox combo = EditForm["ProdWorkstation"].Controls[0] as RadComboBox;
                string ProdWorkstation = combo.Text; //NULL value

How can I do this?

Thanks!
Jayesh Goyani
Top achievements
Rank 2
 answered on 02 Aug 2012
8 answers
585 views
Hello Telerik Team,

I need to achieve a functionality to refresh the scheduler on a button click event.
The button should exist as a link button on the scheduler.I am using sharepoint list as the datasource
Could you provide some pointers on this.

Thank you
Smith

 

Peter
Telerik team
 answered on 02 Aug 2012
1 answer
455 views
I am getting the following error while trying to build my application.

" The type or namespace name 'Script' does not exist in the namespace 'System.Web' (are you missing an assembly reference?)    in   Telerik.Web.UI"

How to solve this error, please help.

Andrey
Telerik team
 answered on 02 Aug 2012
17 answers
245 views

Hello,

I would like to allow the users to select the number of minutes per row of the Scheduler themselves.

I'm trying to reproduce a small part of the Scheduler customization demo page available there:
http://demos.telerik.com/aspnet-ajax/scheduler/examples/customization/defaultcs.aspx

In my very simple example, I only have a drop down list to select the number of minutes and a Scheduler component with no datasource.


Page:
        <telerik:RadScriptManager runat="server" ID="RadScriptManager1" /> 
          
        <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">  
            <AjaxSettings> 
                <telerik:AjaxSetting AjaxControlID="Panel1">  
                    <UpdatedControls> 
                        <telerik:AjaxUpdatedControl ControlID="Panel1" LoadingPanelID="RadAjaxLoadingPanel1" /> 
                    </UpdatedControls> 
                </telerik:AjaxSetting> 
            </AjaxSettings> 
        </telerik:RadAjaxManager> 
        <telerik:RadAjaxLoadingPanel runat="server" ID="RadAjaxLoadingPanel1" /> 
          
        <asp:Panel runat="Server" ID="Panel1">  
                Minutes per row:   
                <asp:DropDownList runat="server" ID="MinutesPerRow" AutoPostBack="true">  
                    <asp:ListItem Value="60" Text="60"></asp:ListItem> 
                    <asp:ListItem Value="30" Text="30" Selected="true"></asp:ListItem> 
                    <asp:ListItem Value="15" Text="15"></asp:ListItem> 
                    <asp:ListItem Value="10" Text="10"></asp:ListItem> 
                </asp:DropDownList> 
                         
            <telerik:RadScheduler runat="server" ID="RadScheduler1"   
                 ShowFullTime="true" OverflowBehavior="Expand" 
                 DataKeyField="ID" DataStartField="Start" DataEndField="End" DataSubjectField="Subject" >                 
            </telerik:RadScheduler> 

Code behind:
    protected override void OnPreRender(EventArgs e)  
    {  
        base.OnPreRender(e);  
 
        RadScheduler1.MinutesPerRow = int.Parse(MinutesPerRow.SelectedValue);  
    } 

This example completely failed.
When I select a value in the drop down list the Panel is refreshing but the Scheduler is still displaying the previous selected value.
I have to do a second post back to obtain the correct layout.

Did I forget something?

Thank you for you help.


Peter
Telerik team
 answered on 02 Aug 2012
1 answer
114 views
Hi all,

Do you have ideas, how to align  text in legend, when you have text format like {text} {value}(you can find details 
in attached image)?

This is simple code, how I create and fill values 
foreach(PieChartItem item in PieChartItemCollection)
            {
                ChartSeriesItem chartItem = item.ChartItem;
                chartItem.Label.TextBlock.Text = String.Format
                            (
                                "{0} {1}"
                                , str1
                                , str2
                            );
            }

Please advice.

Thanks,
Pavlo
 
Rosko
Telerik team
 answered on 02 Aug 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Rob
Top achievements
Rank 3
Bronze
Iron
Iron
Sergii
Top achievements
Rank 1
Iron
Iron
Dedalus
Top achievements
Rank 1
Iron
Iron
Lan
Top achievements
Rank 1
Iron
Doug
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?