Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
104 views
Hi,

I am using RadAsyncUpload to upload image files.
Under some criteria I want to upload file from webserver itself into default folder.

e.g. in combobox I'll have name of image files copied on webserver with their path. If user select any of the option from combobox then file from specified path on webserver will get uploaded ( or copied) to temp folder in same way as RadAsyncUpload doeses if it is selected by user on client side. In this case RadAsyncUpload should point to webserver's folder as source path.
Is there any way to do this all on server side?
Plamen
Telerik team
 answered on 16 Sep 2013
1 answer
77 views
i want visible Button1 when i click. version 2013.1.403.35
page aspx
<telerik:RadGrid ID="RadGrid1" runat="server" OnNeedDataSource="RadGrid1_NeedDataSource" AutoGenerateColumns="false" OnItemCommand="RadGrid1_ItemCommand" OnPreRender="RadGrid1_PreRender">
        <MasterTableView>
            <Columns>
                <telerik:GridTemplateColumn HeaderText="Edit Column" UniqueName="EditColumn">
                    <ItemTemplate>
                        <asp:Button ID="Button1" CommandName="Custom" CommandArgument='<%# Container.DataSetIndex + 1 %>' runat="server" Text="Button" />
                    </ItemTemplate>
                </telerik:GridTemplateColumn>
                <telerik:GridBoundColumn DataField="Column1" HeaderText="Column1"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Column2" HeaderText="Column2"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Column3" HeaderText="Column3"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Column4" HeaderText="Column4"></telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Column5" HeaderText="Column5"></telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>

CS:
List<int> updatedValues = new List<int>();
    protected void Page_Load(object sender, EventArgs e)
    {
        if (ViewState["UpdatedValues"] != null)
        {
            updatedValues = ViewState["UpdatedValues"] as List<int>;
        }
    }
    protected void RadGrid1_NeedDataSource(object sender, Telerik.Web.UI.GridNeedDataSourceEventArgs e)
    {
        DataTable table = new DataTable();
        table.Columns.Add("Column1");
        table.Columns.Add("Column2");
        table.Columns.Add("Column3");
        table.Columns.Add("Column4");
        table.Columns.Add("Column5");
 
        for (int i = 0; i < 20; i++)
        {
            table.Rows.Add("Col1Row" + i, "Col2Row" + i, "Col3Row" + i, "Col4Row" + i, "Col5Row" + i);
        }
 
        RadGrid1.DataSource = table;
    }
 
 
    protected void RadGrid1_ItemCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
    {
        if (e.CommandName == "Custom")
        {
            GridEditableItem item = e.Item as GridEditableItem;
            updatedValues.Add(item.ItemIndex);
 
            // My code processing
        }
    }
    protected void RadGrid1_PreRender(object sender, EventArgs e)
    {
        foreach (int index in updatedValues)
        {
            RadGrid1.MasterTableView.Items[index]["EditColumn"].Controls[0].Visible = false;
        }
 
        ViewState["UpdatedValues"] = updatedValues;
    }

Any solution?

Thanks!
Jayesh Goyani
Top achievements
Rank 2
 answered on 16 Sep 2013
1 answer
73 views
Dears , 
            I have Strange Issue , i enabled sorting to my Grid as the documentation said and follow every thing in the documentations but when i press on the column header to sort , no thing happened ?!  the Grid remained unsorted!...how can i solve it 
here is my code

  <telerik:RadGrid CssClass="paper-table table table-paper table-striped table-sortable table-bordered"
                ID="RadGrid1" runat="server" CellSpacing="0" DataSourceID="SqlDataSource1" EnableLinqExpressions="False"
                ShowStatusBar="True" GridLines="None" AllowSorting="True" AllowFilteringByColumn="True"
                EnableAjax="true" BorderStyle="Solid" BorderWidth="1px" AllowPaging="True" OnItemDataBound="RadGrid1_ItemDataBound"
                OnNeedDataSource="RadGrid1_NeedDataSource">
                
                <AlternatingItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                <MasterTableView DataSourceID="SqlDataSource1" HierarchyLoadMode="Client" AutoGenerateColumns="False"
                    AllowFilteringByColumn="true" 
                    GroupLoadMode="Client" 
                    DataKeyNames="CardId"
                    AllowSorting="true">
                    <DetailTables >
                        
                        <telerik:GridTableView  DataSourceID="SqlDataSource2" BorderColor="Black" DataKeyNames="FK_Card"
                            BorderStyle="Solid" GridLines="Both" AllowFilteringByColumn="false" HierarchyDefaultExpanded="True">
                            
                            <ParentTableRelation>
                                <telerik:GridRelationFields DetailKeyField="CardId" MasterKeyField="CardId" />
                            </ParentTableRelation>


                            <CommandItemSettings ExportToPdfText="Export to PDF" />
                            <RowIndicatorColumn FilterControlAltText="Filter RowIndicator column" Visible="True">
                                <HeaderStyle Width="20px" />
                            </RowIndicatorColumn>
                            <ExpandCollapseColumn FilterControlAltText="Filter ExpandColumn column" Visible="True">
                                <HeaderStyle Width="20px" />
                            </ExpandCollapseColumn>
                            <EditFormSettings>
                                <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                                </EditColumn>
                            </EditFormSettings>
                            <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            <AlternatingItemStyle HorizontalAlign="Center" VerticalAlign="Top" />
                            <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                        </telerik:GridTableView>
                    </DetailTables>
                    <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
                    <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
                        <HeaderStyle Width="20px"></HeaderStyle>
                    </RowIndicatorColumn>
                    <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
                        <HeaderStyle Width="20px"></HeaderStyle>
                    </ExpandCollapseColumn>
                    <Columns>
                        <telerik:GridTemplateColumn UniqueName="TemplateColumn" HeaderText="#" AllowFiltering="false">
                            <ItemTemplate>
                                <asp:Label ID="numberLabel" runat="server" Width="30px" />
                            </ItemTemplate>
                            <HeaderStyle Width="30px" />
                        </telerik:GridTemplateColumn>
                        <telerik:GridBoundColumn DataField="CardNo" FilterControlAltText="Filter CardNo column"
                            HeaderText="Card id" SortExpression="CardNo" UniqueName="CardNo" AllowFiltering="false">
                        </telerik:GridBoundColumn>
                        <telerik:GridBoundColumn DataField="Status_Description" FilterControlAltText="Filter Status_Description column"
                            HeaderText="Status" SortExpression="Status_Description" UniqueName="Status_Description"
                            AutoPostBackOnFilter="true" CurrentFilterFunction="Contains">
                        
                        
                        </telerik:GridBoundColumn>
                       
                    </Columns>
                    <EditFormSettings>
                        <EditColumn FilterControlAltText="Filter EditCommandColumn column">
                        </EditColumn>
                    </EditFormSettings>
                    <ItemStyle BackColor="Transparent" BorderColor="Black" BorderStyle="Solid" HorizontalAlign="Center"
                        VerticalAlign="Middle" />
                    <HeaderStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                </MasterTableView>
                <HeaderStyle BorderColor="Black" BorderStyle="Solid" BorderWidth="1px" HorizontalAlign="Center"
                    VerticalAlign="Middle" />
                <PagerStyle PageButtonCount="15" EnableSEOPaging="True" />
                <FilterMenu EnableImageSprites="False">
                </FilterMenu>
            </telerik:RadGrid>

Kindly i need help in this section , because i have a delivery date !!
Jayesh Goyani
Top achievements
Rank 2
 answered on 16 Sep 2013
2 answers
69 views
In my page,there are 2 web user controls,and I used the RadAjaxManager as well.
Every controls had been bind with RequiredFieldValidator.
The validation works when I clicke the submit button for the first time.
I mean,after I chosen a item from a combobox ,autopostback enabled,the validation would not work any more.
I think ,there must be something wrong with  RadAjaxManager.
coz it works fine without RadAjaxManager.but I must use it in the page.
Thanks in advance.
reezo
Top achievements
Rank 1
 answered on 16 Sep 2013
0 answers
88 views
hello all

I have a master page containing rad menu item. In my database there is user wise menu access. I want to give the access of each menu from the database. How can i do that also please let me know how to change the visibility of telerik radmenuitem dynamically?
Thanks in advance.
Shubhadeep
Top achievements
Rank 1
 asked on 15 Sep 2013
0 answers
71 views
Grid.get_masterTableView().get_dataItems()[document.getElementById("radGridClickedRowIndex").value].get_element().click();
this code works.but the one below does'nt.
Grid.get_masterTableView().get_dataItems()[document.getElementById("radGridClickedRowIndex").value].get_element().dblclick();
C
Top achievements
Rank 1
 asked on 14 Sep 2013
0 answers
87 views
I created a page with a tabstrip control and a Multipage control. The MultipPageID of the Tabstrip is set to the ID of the Multippage. In the codebehind, I load the tabs. I have the Tabstrip_TabClick event coded and the MultipPage_PageViewCreated coded.

The first time I click on a tab, the TabClick event fires, where I add a new pageview for the tab.
If I click a different tab, the PageViewCreated event fires before the TabClick event. At this point, I have no clue what tab was clicked, and don't know what to load. I tried using the tabstrip.selected property, but that shows the tab that was selected before I clicked the new tab.

What is going on here? How do I get the TabClick event to fire BEFORE the PageViewCreated?

EDIT: I just realized what is happening. The first time, there was't a pageview, so it had nothing to load in the PageViewCreated event. So, it executed the tabstrip_tabclick event. The second time I clicked a tab, it reloaded the first pageview and then created new pageview via the tabclick event. The third tab loads the first two pageviews via the pageviewcreated event, then the tabclick event for the third tab and then the new pageviewcreated event for the third tab.

Ok, now I understand...
Steve
Top achievements
Rank 1
 asked on 14 Sep 2013
1 answer
109 views
I have code like this:

MyRadDatePicker.SelectedDate = DateTime.Now

and the text box doesn't update.

Do I need to call an update function or something?
Raymond
Top achievements
Rank 1
 answered on 13 Sep 2013
12 answers
1.0K+ views
I'm trying to implement a "classic" solution where filtering, sorting and paging happens at db level and the retrieved resultset is only the one needed. That way it should be lighter to handle bigger database since if you have a page of 50 items you only set those 50 items as datasource.
I would like to keep a tradeoff between this performance boost and the automatic functionalities the grid offers (mostly in the CRUD scendario, of course I'll have to handle all the selects for paged and filtered datasets)
Anyway... I'm trying to accomplish this with NeededDataSource (I was wondering if ObjectDataSource is better for this.. is it?)
I'm finding my way through paging and this is quite straightforward: 

Protected Sub RadGrid1_NeedDataSource(sender As Object, e As GridNeedDataSourceEventArgs)
    Dim dataSource As New MyUsersManager
    Dim query As New PagedQuery
    Dim result As ResultPage(Of MyUser)
 
    query.ItemsPerPage = RadGrid1.MasterTableView.PageSize
    query.PageNumber = RadGrid1.MasterTableView.CurrentPageIndex + 1
 
    result = dataSource.GetPage(query)
 
    RadGrid1.MasterTableView.VirtualItemCount = result.TotalItems
    RadGrid1.MasterTableView.DataSource = result.Items
End Sub

The problem is that I always get page index 0... even if the pager updates and I'm on page 2 or 3 I always get pagindex 0 in the NeedDataSource events... why?

I wonder how can I factor in the filtering and the sorting... How can I retrieve the filtering parameters and sorting (maybe even multisorting) parameters inside NeedDataSource? Should I create page properties that are updated from filtering and sorting events and then read from NeedDataSource event, or is there a more straightforward way to do it?

What about grouping? Will this work with my custom implementation? I suppose it won't show the summaries for grouped paging anymore (like "you are viewing n records of group x and still more y records on next page" or such) but will it work the same? Or do I have to retrieve the whole 1 milion records dataset to benefit from grouping? Same for footer summaries, will those work on a single page basis or do they only work with the full db?

I think this should be a common scenario for larger implementation for e-commerce sites, or where db grows to a considerable size in general  (like for example in a multiapp SaaS framework wich serves multiple sites from a single app and the DB has data from all the sites)

Thanks in advance
Massimiliano
Top achievements
Rank 1
 answered on 13 Sep 2013
1 answer
115 views
Hello,

I'm attempting to allow my users to select multiple items inside a RadPanelBar.  To accomplish this, I have programmatically added CheckBoxes inside each RadPanelItem.  However, they are appearing on their own line.  Is there a way to align the CheckBoxes to the same line as the text of the RadPanelItem?  I have included an image for reference.

Also, If there is an easier way to display hierarchical data allowing multiple selection, I'm open to the idea of using another control instead.  (Could RadTreeView and/or RadTreeList be options?)

Thank you for your help!

Regards,
Brian Chambers
Brian
Top achievements
Rank 1
 answered on 13 Sep 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?