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

I have a TreeView on my page which is bound to an XMLDataSource that is generated from a SQL Stored Procedure within a static method.  The method takes a single parameter and returns the XML tree-structure based on the parameter.  This all works great.

If I change the root parameter for the XMLDataSource, the resulting XML is all good, but I cannot get the TreeView to update with the new data!  I've tried everything I can think of, setting the XMLDataSource to NULL beforehand, removing any caching, etc.

Any help would be greatly appreciated.

Thanks
Dimitar Terziev
Telerik team
 answered on 21 Dec 2010
2 answers
242 views
HI,
I using rad grid hierarchy. If i dont have any commandname for expandcollapse column the grid is expanding. But if have a commandname. The grid is not expanding. Is there any code do i need to write in commandname. Please help me. I searched online but i didn't find any solution. Here si my sample code

<telerik:RadGrid ID="RGCMnbr" runat="server" AutoGenerateColumns="false" Height="520px"
                                                                    BorderWidth="1px" BorderStyle="Solid" GridLines="None" BackColor="White" AllowPaging="True"
                                                                    PageSize="20" AllowSorting="True" OnNeedDataSource="RGCMnbr_OnNeedDataSource"
                                                                    EnableEmbeddedSkins="false" ShowGroupPanel="false" ShowStatusBar="false" OnItemDataBound="RGCMnbr_ItemDataBound"
                                                                    OnItemCommand="RGCMnbr_ItemCommand" MasterTableView-RowIndicatorColumn-Display="false"
                                                                    OnDetailTableDataBind="RGCMnbr_DetailTableDataBind">
                                                                    <HeaderStyle Height="20px" BackColor="#004000" Font-Size="8pt" Font-Bold="True" ForeColor="White"
                                                                        HorizontalAlign="Center" BorderColor="White" BorderWidth="1px" />
                                                                    <ItemStyle HorizontalAlign="Center" />
                                                                    <AlternatingItemStyle BackColor="#F5F5E9" HorizontalAlign="Center" />
                                                                    <PagerStyle BackColor="#F5F5E9" />
                                                                    <MasterTableView DataKeyNames="cmId" Name="Master" GridLines="None" ExpandCollapseColumn-ButtonType="ImageButton"
                                                                        ExpandCollapseColumn-CollapseImageUrl="Images/Right.gif" ExpandCollapseColumn-ExpandImageUrl="Images/Right.gif" ExpandCollapseColumn-CommandName="Expand">
                                                                        <DetailTables>
                                                                            <telerik:GridTableView Name="Orders" Width="80%" DataKeyNames="smId">
                                                                                <HeaderStyle Height="15px" BackColor="#004000" Font-Size="8pt" Font-Bold="True" ForeColor="White"
                                                                                    HorizontalAlign="Center" BorderColor="White" BorderWidth="1px" />
                                                                                <ItemStyle HorizontalAlign="Center" />
                                                                                <AlternatingItemStyle HorizontalAlign="Center" />
                                                                                <Columns>
                                                                                    <telerik:GridBoundColumn UniqueName="smId" DataField="smId" HeaderText="smId" Visible="false">
                                                                                    </telerik:GridBoundColumn>
                                                                                    <telerik:GridBoundColumn HeaderText="SM Number" UniqueName="smNumber" DataField="smNumber">
                                                                                    </telerik:GridBoundColumn>
                                                                                    <telerik:GridBoundColumn HeaderText="Sch Imp Date" DataField="smSchImpDate" UniqueName="smSchImpDate"
                                                                                        DataFormatString="{0:MM/dd/yyyy}">
                                                                                    </telerik:GridBoundColumn>
                                                                                    <telerik:GridBoundColumn HeaderText="SM Status" DataField="smStatus" UniqueName="smStatus">
                                                                                    </telerik:GridBoundColumn>
                                                                                    <telerik:GridBoundColumn HeaderText="Created Date" DataField="smCreatedDate" UniqueName="smCreatedDate"
                                                                                        DataFormatString="{0:MM/dd/yyyy}">
                                                                                    </telerik:GridBoundColumn>
                                                                                    <telerik:GridBoundColumn HeaderText="Created By" DataField="smCreatedBy" UniqueName="smCreatedBy">
                                                                                    </telerik:GridBoundColumn>
                                                                                    <telerik:GridBoundColumn HeaderText="Approved Date" DataField="smApprovedDate" UniqueName="smApprovedDate"
                                                                                        DataFormatString="{0:MM/dd/yyyy}">
                                                                                    </telerik:GridBoundColumn>
                                                                                    <telerik:GridButtonColumn UniqueName="EditSMNbr" CommandName="EditSM" ButtonType="ImageButton"
                                                                                        ImageUrl="~/Images/edit-icon-v5.gif" HeaderStyle-Width="5%" ItemStyle-Width="5%">
                                                                                    </telerik:GridButtonColumn>
                                                                                    <telerik:GridButtonColumn UniqueName="DeleteSmNbr" CommandName="DeleteSM" ButtonType="ImageButton"
                                                                                        ImageUrl="~/Images/Delete.gif" HeaderStyle-Width="5%" ItemStyle-Width="5%">
                                                                                    </telerik:GridButtonColumn>
                                                                                </Columns>
                                                                                <NoRecordsTemplate>
                                                                                    No SM numbers to dispaly</NoRecordsTemplate>
                                                                            </telerik:GridTableView>
                                                                        </DetailTables>
                                                                        <Columns>
                                                                            <telerik:GridBoundColumn UniqueName="cmId" HeaderText="cmId" DataField="cmId" Visible="false"
                                                                                ReadOnly="true">
                                                                            </telerik:GridBoundColumn>
                                                                            <telerik:GridBoundColumn DataField="CMNumber" UniqueName="CMNumber" HeaderText="CM Number">
                                                                            </telerik:GridBoundColumn>
                                                                            <telerik:GridBoundColumn HeaderText="CM Type" DataField="CMType" UniqueName="CMType">
                                                                            </telerik:GridBoundColumn>
                                                                            <telerik:GridTemplateColumn HeaderText="Dependent Sites" DataField="DependentSites"
                                                                                UniqueName="DependentSites">
                                                                                <ItemTemplate>
                                                                                    <asp:LinkButton Text='<%# Bind("DependentSites") %>' runat="server" ID="lnkDepenSites"
                                                                                        CommandName="Orders"></asp:LinkButton>
                                                                                </ItemTemplate>
                                                                            </telerik:GridTemplateColumn>
                                                                            <telerik:GridBoundColumn HeaderText="Req Imp Date" DataField="ReqImpDate" UniqueName="ReqImpDate"
                                                                                DataFormatString="{0:MM/dd/yyyy}">
                                                                            </telerik:GridBoundColumn>
                                                                            <telerik:GridBoundColumn HeaderText="CM Status" DataField="CMStatus" UniqueName="CMStatus">
                                                                            </telerik:GridBoundColumn>
                                                                            <telerik:GridBoundColumn HeaderText="CM Step Number" DataField="CMStepNumber" UniqueName="CMStepNumber">
                                                                            </telerik:GridBoundColumn>
                                                                            <telerik:GridBoundColumn HeaderText="CM Step Status" DataField="CMStepStaus" UniqueName="CMStepStaus">
                                                                            </telerik:GridBoundColumn>
                                                                            <telerik:GridBoundColumn HeaderText="Create Date" DataField="CreatedDate" UniqueName="CreatedDate"
                                                                                DataFormatString="{0:MM/dd/yyyy}">
                                                                            </telerik:GridBoundColumn>
                                                                            <telerik:GridBoundColumn HeaderText="Created By" DataField="CreatedBy" UniqueName="CreatedBy">
                                                                            </telerik:GridBoundColumn>
                                                                            <telerik:GridBoundColumn HeaderText="Approved Date" DataField="ApprovedDate" UniqueName="ApprovedDate"
                                                                                DataFormatString="{0:MM/dd/yyyy}">
                                                                            </telerik:GridBoundColumn>
                                                                            <telerik:GridButtonColumn UniqueName="EditCMNbr" CommandName="EditCM" ImageUrl="~/Images/edit-icon-v5.gif"
                                                                                ButtonType="ImageButton" HeaderStyle-Width="3%" ItemStyle-Width="3%">
                                                                            </telerik:GridButtonColumn>
                                                                            <telerik:GridButtonColumn UniqueName="AddSMNbr" CommandName="AddSM" ImageUrl="~/Images/add-icon.png"
                                                                                ButtonType="ImageButton" HeaderStyle-Width="3%" ItemStyle-Width="3%">
                                                                            </telerik:GridButtonColumn>
                                                                        </Columns>
                                                                        <NoRecordsTemplate> No CM numbers to display</NoRecordsTemplate>
                                                                    </MasterTableView>
                                                                    <ClientSettings>
                                                                        <Scrolling AllowScroll="true" UseStaticHeaders="true" ScrollHeight="450px" />
                                                                    </ClientSettings>
                                                                </telerik:RadGrid>




if (e.CommandName == "Expand")
{
    GridDataItem dataItem = (GridDataItem)e.Item;
    lblCMNbr.Text = dataItem["CMNumber"].Text.Trim();
    lblReqImpDt.Text = dataItem["ReqImpDate"].Text.Trim();
}
Srinivasa Gokidi
Top achievements
Rank 1
 answered on 21 Dec 2010
3 answers
84 views

I've worked at this for several days and searched for a solution, found several portions and built them all but I still can't figure this simple thing out.

I have an Ajaxified Grid (EnabledAjax="True") in which I have GridTemplateColumn which contains an asp:Image tags to display a thumbnail of the image.  The image resides in the filesystem.  Works great.

In the EditFormSettings, because I have so many fields, I organize them into RadTabStrip and a RadMultiPage.  On the Photos tab, I display the three pictures (Thumbnail, Small and Large Image) in a div along with a RadUpload.  I can get the picture to display, my textbox containing the relative path to the image.  Works good.

The problem comes during the upload, I select a picture and press the Upload button.  Good so far!  I catch the server side postback Click event, find the control for the image, get the parent, then set the correct imageURL, the correct relative datapath.  All seems to work, but (and here's the problem) it won't change the EditFormSettings page to reflect the changes which should then post to the database or reflect the changes and allow me to press the Update button.  It just closes the form and every change is lost and the EditForm closes losing the changes.

Here is my click event:

protected void ButtonUploadThumbnailImage_Click(object sender, EventArgs e)
    {
        Button btn = (Button)sender;
        GridEditFormItem editFormItem = (GridEditFormItem)btn.NamingContainer;  //Access the EditFormItem
        RadUpload upload = (RadUpload)editFormItem.FindControl("UploadThumbnailImage");

        if (upload.UploadedFiles.Count > 0)
        {
            Image image = (Image)editFormItem.FindControl("ThumbnailImage");
            image.ImageUrl = ResolveUrl("~/Images/Products/" + upload.UploadedFiles[0].GetName());

            TextBox txt1 = (TextBox)editFormItem.FindControl("txtThumbnailImagePath");
            txt1.Text = "~/Images/Products/" + upload.UploadedFiles[0].GetName();
        }
    }

My html example is:

<td valign="top" 
align="center"><BR>                                                                        
<telerik:RadUpload ID="UploadThumbnailImage" runat="server" Width="250px" 
Height="24px"<BR>                                                                            
AllowedFileExtensions="jpg,jpeg,png,gif" ControlObjectsVisibility="None" 
TargetFolder="~/Images/Products" 
<BR>                                                                            
OverwriteExistingFiles="false" 
><BR>                                                                        
</telerik:RadUpload><BR>                                                                        
<br 
/><BR>                                                                        
<asp:Button ID="ButtomUploadThumbnailImage" runat="server" Text="Upload" 
CommandName="Update"<BR>                                                                            
CommandArgument="UploadThumbnailImage" 
OnClick="ButtonUploadThumbnailImage_Click" /><br 
/><BR>                                                                        
<asp:Image ID="ThumbnailImage" runat="server" ImageUrl='<%# ResolveUrl("~" 
+ Eval("ThumbnailImageURL")) 
%>'<BR>                                                                            
Visible='<%# Eval("ThumbnailImageURL").Equals("") ? false: true %>' 
/><br 
/><BR>                                                                        
<asp:TextBox ID="txtThumbnailImagePath" runat="server" Text='<%# 
Eval("ThumbnailImageURL") 
%>'<BR>                                                                            
Width="200px"></asp:TextBox><BR>                                                                    
</td><BR><BR><BR>

How do I display an image using a relative path from the database, allow the user to upload and change the picture (or select one already uploaded) and then reflect the change in the EditForm but not save it to the database until the EditFormSettings Update button is pressed?

Thanks

Veli
Telerik team
 answered on 21 Dec 2010
4 answers
182 views
Hi,
I have the following in a GridTemplateColumn
<telerik:RadButton ID="rbTest" runat="server" ButtonType="ToggleButton" Style="padding-left: 25px"
                        ToggleType="CheckBox" AutoPostBack="false" Checked='<%# Test(Eval("Test")) %>'>
                        <ToggleStates>
                            <telerik:RadButtonToggleState PrimaryIconCssClass="rbOk" />
                            <telerik:RadButtonToggleState PrimaryIconCssClass="rbCancel" />
                        </ToggleStates>
                    </telerik:RadButton>
On the ItemDataBound I am trying to add the OnClientClicked Event, I've also tried the OnClientCheckChanged. I find the control in Editemode and try the below

rbTest.Attributes.Add(

 

"OnClientCheckedChanged", "return show('0','0')");

It just doesn't seem to be firing.

Any ideas?

Thanks

 

Karl
Top achievements
Rank 1
 answered on 21 Dec 2010
1 answer
55 views
Hi,

    I am using Rad Scheduler in my application .It works fine .
I want to Change the Header and Side bar color ..
How can we set the Color ?.Please give me any suggestions for this ..

Thanks
Prabha
Veronica
Telerik team
 answered on 21 Dec 2010
4 answers
136 views
Dear Support,

I have a dropdownlist in RadGrid detailtables, when the dropdownlist selectindexchanged, I want to know how to retrieve the datakeyvalue from item in radgrid detailtables.

Please help!

Alan
Alan Wang
Top achievements
Rank 1
 answered on 21 Dec 2010
1 answer
79 views
In my RadScheduler each appointment can have multiple resources of the same type (e.g. an appointment can have 2 salespeople on it).   I implemented a custom provider to accomplish this and everything renders fine -- if I have my scheduler grouped by salesperson and date, the appointment will show up under both salespeople (see screenshot 1).

Now let's say I want to reschedule that appointment by dragging it to a new time slot.  To do so, I can drag either the appointment listed under my first salesperson or my second salesperson.   If I drag the appointment box for the first Salesperson it works as expected -- the scheduler is updated so the new appointment time is reflected for both salespeople. (see screenshots 2 and 3)

However, if I go to drag the appointment for the second Salesperson, it actually starts dragging the appointment block for the first salesperson instead of the second salesperson.   It's as if the drag and drop code in the scheduler is selecting the wrong appointment block when that appointment is on the scheduler multiple times due to it having multiple resources of the same type. (see screenshot 4)

Here's a more detailed explanation of what each screenshot shows:

1. A single appointment in Indianapolis scheduled for 12:30pm that has two salespeople (01TECH and 02TECH).  It correctly renders for each salesperson on the scheduler

2. I then decide I want to reschedule the appointment to 10:00am so I drag the appointment listed under 01TECH from 12:30pm to 10:00am.  This shows that dragging working properly.

3. After I drop the appointment at 10:00am this shows how the scheduler updates.  This is correct.  It shows the appointment now at 10:30am and it still has it listed under each Salesperson.

4.  Shows the problem when I try to do the same thing by dragging the appt listed for 02TECH.  Here I actually tried to click and drag the 12:30pm appointment listed under 02TECH, but the scheduler picks up the 12:30pm appointment for 01TECH and uses that for the drag operation.

Is this a known issue?   Are there any workarounds or fixes?

Thanks....
Peter
Telerik team
 answered on 21 Dec 2010
0 answers
267 views
We have identified several occurrences of multiple/duplicated ToolBox items existing in the Visual Studio Toolbox. Unfortunately these seem to stem from a glitch in Visual Studio, which was still not reproduced reliably so that we can fix it, or ask Microsoft for a fix.

Below are the different kinds of occurrences and their possible fixes:
  • Duplicate Toolbox items, remaining two entries per control:
    • this could be a result of having parallel RadControls installations, which is the correct behavior (Visual Studio 2008 only)
    • this could be the result of an improper deregistration of an older RadControls distribution, followed by the registration of the newer one. Usually either of the two approaches below helps fixing the problem:
      • Close Visual Studio instances, start Windows Explorer, navigate to %localappdata%\Microsoft\VisualStudio\10.0 and delete the *.tbd files
      • Right-click the Toolbox inside Visual Studio and click Reset
  • Multiple entries per control, number increasing with each start of the IDE: this is the worst scenario we have come across. All the registry entries and files on the customer machine seemed fine in this case. The only fix we were able to apply was a complete uninstall of RadControls and Visual Studio 2010, followed by a clean install of the IDE and the RadControls.
Kind regards,
Erjan Gavalji
The Telerik team
Telerik Admin
Top achievements
Rank 1
Iron
 asked on 21 Dec 2010
1 answer
102 views
Hi, I'm trying to change the style for the select button so the cursor is pointer instead, any tips how to do it?

/Rickard
Genady Sergeev
Telerik team
 answered on 21 Dec 2010
2 answers
195 views
Hey!

I am using a RadListView. Every item contains just one Image button like this:

<ItemTemplate>
    <fieldset style="float: left; width: 270px; height: 110px;">
        <div>
            <asp:ImageButton ID="imgCategory" runat="server" OnClick="imgCategory_Click" OnDataBinding="imgCategory_DataBind"
CommandArgument='<%# Eval("CategoryId") %>'/>
        </div>
     </fieldset>
</ItemTemplate>

I load the ImageButtons dynamacily in the codebehind, now I would like to change the Image source (ImageUrl) on MouseOver and on MouseOut is that possible.

Do you have any different solution in your mind?

Thanks for your asistance.

Sincerely, Jure
Jure
Top achievements
Rank 1
 answered on 21 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?