Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
171 views
In my grid I have 3 columns, a combo, textbox and RADUpload

in the UpdateCommand event I create an instance of the combo, textbox and RADUpload
If the user hasnt uploaded any files, I want to keep the original uploadURL values, How can I get to them from the UpdateCommand Event ?

the datasource bound to the grid is simply a list of a custom class Ive created
public class CastMemberObj  
    {  
        public int ID { get; set; }  
        public string CastMemberName { get; set; }  
        public string CastMemberInformation { get; set; }  
        public string PhotoURL { get; set; }  
        public string ThumbnailURL { get; set; }  
        public string Type { get; set; }  
    } 
  So in the UpdateCommande event I simply want to get access to the contents of the original PhotoURL & ThumbnailURL
These arent displayed in the grid, but they are part of the datasource.

protected void RadGridCast_UpdateCommand(object source, Telerik.Web.UI.GridCommandEventArgs e)  
        {  
            var editableItem = ((GridEditableItem)e.Item);  
            var productId = (int)editableItem.GetDataKeyValue("ID");  
            TheCompanyBL.CastMemberObj castmember = new TheCompanyBL.CastMemberObj();  
            string thumbURL = string.Empty;  
            string ImageURL = string.Empty;  
            string url = TheCompanyBL.Helpers.GetSiteURL();  
            string ImageUploadURL = url + "/Uploads/";  
 
            RadTextBox tb = (RadTextBox)e.Item.FindControl("txbCastMember");  
            if (tb != null)  
            {  
                castmember.CastMemberName = tb.Text;  
            }  
            else  
            {  
                castmember.CastMemberName = "";  
            }  
 
            RadComboBox rcb = (RadComboBox)e.Item.FindControl("RadComboBoxType");  
            if (rcb != null)  
            {  
                castmember.Type = rcb.SelectedValue;  
            }  
            else  
            {  
                castmember.Type = "";  
            }  
 
              
 
            TheCompanyBL.CastMemberObj member = (TheCompanyBL.CastMemberObj)e.Item.DataItem;  
            Image img = (Image)e.Item.FindControl("ImageThumbNail");  
            if (null != img)  
            {  
 
            }  
            RadUpload ru = (RadUpload)e.Item.FindControl("RadUploadImage");  
            if (null != ru)  
            {  
                string target = Server.MapPath(ru.TargetFolder);  
 
                if (ru.UploadedFiles.Count > 0)  
                {  
                    string sFileType = ru.UploadedFiles[0].GetExtension();  
                    foreach (UploadedFile f in ru.UploadedFiles)  
                    {  
                        imagemanager.ResizeAndSave(ru.UploadedFiles[0], ImageUploadURL, target, "CastMembers", true, out thumbURL);  
                        imagemanager.ResizeAndSave(ru.UploadedFiles[0], ImageUploadURL, target, "CastMembers", false, out ImageURL);  
                        castmember.ThumbnailURL = thumbURL;  
                        castmember.PhotoURL = ImageURL;  
                    }  
                }  
            }  
            //retrive entity form the Db  
 
            //update entity's state  
            //editableItem.UpdateValues(castmember);  
            string err = castmembermanager.Update(castmember);  
        } 


Ive tried to cast the dataItem to my custom class but its always null

TheCompanyBL.CastMemberObj member = (TheCompanyBL.CastMemberObj)e.Item.DataItem;  

can anyone help me out ?
Casey
Top achievements
Rank 1
 answered on 07 Oct 2009
1 answer
136 views
I am facing problem when i browse my application in IE6, the RadFileExplorer Treeview always shows the horizontal scroll bars.
Even if you explore the templates provide by Telerik showing the same issue.



Lini
Telerik team
 answered on 07 Oct 2009
5 answers
190 views
In Multipage RadPageView control I use server validation. When I set button's property to 'causesvalidation=true'
<telerik:RadPageView runat="server" ID="CMPageView" Width="460px">  
        <div class="viewWraptabs tabposition arial">  
            <p class="red">Date: <%=DateTime.Now.ToShortDateString() %></p>  
             <uc2:ssncontrol id="ssn" runat="server" controlposition="16,65" tbwidth="155px"/>  
             <asp:requiredvalidator id="rvdob" runat="server" controltovalidate=="RadDatePicker1" errormessage="dob is required"/>    
            <span class="positionT arial">Date of Birth*: </span> 
            <telerik:raddatepicker id="RadDatePicker1" runat="server" skin="Black" cssclass="positionTD" width="130px" calendar-rangemindate="1/1/1940 12:00:00 AM" mindate="1/1/1940 12:00:00 AM"  dateinput-mindate="1/1/1940 12:00:00 AM" /> 
                        <span class="positionS arial">Have you ever had an accident:<span class="space80"></span> <asp:checkbox id="cbacc" runat="server"/></span> 
            <span class="positionSD arial">Have you ever been charged<br /> with a violation?<span class="space50"></span><asp:checkbox id="cbv" runat="server"/></span> 
               
             <textarea id="taacc" cols="30" rows="5" class="positionF" runat="server" validateemptytext="true" validationgroup="mmm"></textarea> 
               
            <textarea id="taviol" cols="30" rows="5" class="positionFD" runat="server"></textarea> 
            <div style="background: url(Img/bg.gif) no-repeat; width: 600px; height: 362px; padding-top: 24px;  
            text-align: center;position:absolute;left:150px;top:290px"> 
<asp:Button Text="Add Member Info" OnClick="AddMemberInfo_Click" runat="server" ID="bmember" 
Style="width: 116px;" causesvalidation="true" usesubmitbehavior="true"></asp:Button> 
<asp:Button Text="Cancel"  runat="server" ID="bcancel" causesvalidation="false" 
Style="width: 116px;"></asp:Button> 
</div> ...etc...
</telerik:RadPageView>
 
, events are not fired anymore. When I turn validation off, event is firing on click. How I can resolve this issue?

I forgot to mention that this is happening on second page. With first page everything is fine. I use multiple pages for tabstrip.
Martin
Telerik team
 answered on 07 Oct 2009
3 answers
106 views

Hi,

I'm having a problem when I delete the last item in a detail table, which causes the parent row to be deleted as well.
I get client errors saying "Parent table relations set, but no corresponding data-key name found" and "Index was out of range. Must be non-negative and less than the size of the collection. Parameter name: index"

The master table and the detail table are both bound at the same time during the grids NeedDataSource event.  I have tried setting the HierarchyLoadMode to different values, but it didn't help. 

The delete command item is on the child table.  The delete happens successfully, the DataSource is set to null, the NeedDataSource event occurs, and table is given new data for both the master table and the detail table.

The error only happens when the row is the very LAST row in the grid and all the child items are deleted, causing the parent row to disappear.  If it’s the first row or one of the middle rows, no error occurs.  If it is the only row in the grid you receive the error "Parent table relations set, but no corresponding data-key name found".  If there's more than 1 row, you get the "Index was out of range" error.

Anyone ever encounter anything like this?  Any ideas for workarounds?

Thanks

-Adam

 

Adam
Top achievements
Rank 1
 answered on 07 Oct 2009
1 answer
116 views
Hi,

In my page, am having many tabs.Within every tab, Grids are available.

Grids are having insert/edit/delete operations. While inserting/editing/deleting , the page fully got  postback.

In order to reduce the page postback  am using radajaxmanger,i put following lines

<telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
            <AjaxSettings>
                <telerik:AjaxSetting AjaxControlID="grdIssues">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="grdIssues" />                        
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="grdMessages">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="grdMessages" />                        
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="grdLinks">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="grdLinks" />                        
                    </UpdatedControls>
                </telerik:AjaxSetting>
                <telerik:AjaxSetting AjaxControlID="grdManufacturers">
                    <UpdatedControls>
                        <telerik:AjaxUpdatedControl ControlID="grdManufacturers" />                        
                    </UpdatedControls>
                </telerik:AjaxSetting>              
               
            </AjaxSettings>
        </telerik:RadAjaxManager>

But sometimes, it is working.Mostly page postback is happening while doing grid(insert/edit) operations.
i dont want postback while doing grid insert/edit/delete .

and how can i put the ajax update controls for tabs and Grids?tabs may be the problem?

Thanks for your help
Veli
Telerik team
 answered on 07 Oct 2009
1 answer
77 views
Here is my code:

                    Dim PBItem1 As New Telerik.Web.UI.RadPanelItem 
                    PBItem1.Text = result.blm_title.ToString 
                    PBItem1.ToolTip = result.blm_subtitle.ToString 
                    PBItem1.CssClass = "Black9b" 
                    PBItem1.NavigateUrl = "~/crBlogMaster.aspx?id=" + result.blm_id.ToString 
 
                    RadPanelBar1.Items(1).Items.Add(PBItem1) 

The class "Black9b" is part of my Theme associated with the aspx page and it is not getting assigned to the PanelBar item.
Paul
Telerik team
 answered on 07 Oct 2009
2 answers
111 views
Hi,

Sometimes we are getting a HTTPHandler error for the radProgressarea.Below is the sample of the error message

RadUpload Ajax callback error

Teelrik.raduploadProgresshandler.ashx?radurid=988328323
Did You register the radUploadprogresshandler in the web.config file?

Actually we have registered the same in the web.config already.Any idea whatr would be the cause for this issue.
This occurs rarely.

Web.config content:
--------------------------------

<

 

httpHandlers>

 

<

 

add verb="*" path="Telerik.RadUploadProgressHandler.ashx" type="Telerik.Web.UI.RadUploadProgressHandler, Telerik.Web.UI"/>

 

</

 

httpHandlers>

 

<

 

httpModules>

 

<

 

add name="RadUploadModule" type="Telerik.Web.UI.RadUploadHttpModule, Telerik.Web.UI"/>

 

</

 

httpModules>

 

<

 

httpRuntime maxRequestLength="1228800" />

 



Thanks and Regards
V.Balamurali
Balamurali Venkatesan
Top achievements
Rank 1
 answered on 07 Oct 2009
2 answers
146 views
Hello,

I have a Grid with MasterTable and DetailTable and I create all columns on code behind.
At first, I delete all existing Columns and add all needed columns.

My fist column shoud be the ExpandCollapse-column. Here the c# code:

 

GridExpandColumn oEC = new GridExpandColumn();  
oEC.ButtonType = GridExpandColumnType.SpriteButton;  
oEC.CommandName = "ExpandCollapse";  
oEC.UniqueName = "ExpandCollapse";  
oEC.ItemStyle.Width = Unit.Pixel(20);  
oEC.HeaderStyle.Width = Unit.Pixel(20);  
oEC.FooterStyle.Width = Unit.Pixel(20);  
oEC.Display = true;  
oEC.Visible = true;  
this.RadGridDistribution.Columns.Add(oEC);  
 


My problem is, I get no bostback by clicking.

I hope, anybody can give me a tip.

Detlef!

 

 

 

 

FLIDEV
Top achievements
Rank 2
 answered on 07 Oct 2009
2 answers
123 views

This option, employed on the telerik forum pages used to have the option to "include line numbers".

It's gone.

Can we have it back please?

-- 

Stuart

Stuart Hemming
Top achievements
Rank 2
 answered on 07 Oct 2009
2 answers
125 views
Hello,

I have an treeview with chekcboxes and tristatecheckboxes ist true. Is it possible to get the intermediate state of an parent node? The node is in the CheckedNodes-collection, but I can't find any property to differ the state.

I hope, anybody can help me.

Detlef!
FLIDEV
Top achievements
Rank 2
 answered on 07 Oct 2009
Narrow your results
Selected tags
Tags
+? more
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Tien
Top achievements
Rank 1
Iron
Krasimir
Top achievements
Rank 3
Bronze
Iron
Iron
Cedar
Top achievements
Rank 1
Iron
Emil
Top achievements
Rank 1
Iron
Kyle Watson
Top achievements
Rank 1
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?