Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
158 views
Sir,
          I have an issue with Rad-active I Load control.While uploading the image, it will display sometimes. Sometimes it won't display the image message and show a java script error in IE.The sample code for this application is shown below,


<script type="text/javascript">
                //<![CDATA[

    function ILoad1_ValueChanged(controlId, webImage) {
        
        if (webImage) {
            var resize = webImage.GetResizeByName("Image2");
            var str = "<table border=\"0\" cellpadding=\"0\" cellspacing=\"0\" style=\"width:90px; height:90px;\"><tr><td align=\"center\" valign=\"middle\">";
            str += "<a href=\"javascript:void(0);\" onclick=\"Radactive.WebControls.ILoad.ShowImagePreview('<% =this.ILoad1.ClientID %>'); return false;\">";
            str += "<img src=\"" + resize.FileUrl_NoCache() + "\" alt=\"\" style=\"border:none;\" />";
            str += "</a>";
            str += "</td></tr></table>";
            document.getElementById("ILoad1_Image2").innerHTML = str;
            

        }
        else {
            var str = "<table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" style=\"width:90px; height:90px;\"><tr><td align=\"center\" valign=\"middle\">";
            str += "<a href=\"javascript:void(0);\" onclick=\"Radactive.WebControls.ILoad.ShowImagePreview('<% =this.ILoad1.ClientID %>'); return false;\">";
            str += "<img src=\"../Images/CompanyLogo/noimage.jpg\"  height=\"110px\" width=\"90px\" alt=\"\" style=\"border:none;\" />";
            str += "</a>";
            str += "</td></tr></table>";   
            document.getElementById("ILoad1_Image2").innerHTML = str;
          }
    }

    var ILoad1_PageLoad_Done = false;
    var ILoad1_ControlInitialized_Done = false;
    function ILoad1_PageLoad() {
        if (ILoad1_PageLoad_Done) {
            return;
        }
        ILoad1_PageLoad_Done = true;

        var controlId = "<% =this.ILoad1.ClientID %>";
        ILoad1_ValueChanged(controlId, Radactive.WebControls.ILoad.GetValue(controlId));
    }
    function ILoad1_ControlInitialized(controlId, webImage) {
        ILoad1_ControlInitialized_Done = true;
   
        listenEvent(window, "load", ILoad1_PageLoad);
    }
                //]]>   
</script>
<script type="text/javascript">
                //<![CDATA[
    if (ILoad1_ControlInitialized_Done) {
        ILoad1_PageLoad();
    }
                //]]>   
</script>




The control creation is like this,


 <RAWCIL:ILoad ID="ILoad1" runat="server" Appearance="Button" ForeColor="#0C55B1"
                                    CssClass="button-new" Width="100px" Height="25px"><Configuration ManualTemporaryFolder="False"
                                    OnCompleteBehavior="KeepFilesInTemporaryFolder"
                                    WebPublishedDestinationFolder="True" CutMode="Manual" KeepSourceImage="False"
                                    GenerateIconImage="False" GenerateSelectedImage="True"
                                    GenerateIndexXMLFile="True" InternalCode="" Title="">
                                    <TemporaryFolder Path="" UrlMode="Automatic" ManualUrl=""></TemporaryFolder>
                            <DestinationFolder Path="" UrlMode="Automatic" ManualUrl=""></DestinationFolder>
                            <WebImageDefinitions>
                             <Radactive.WebControls.ILoad.Configuration.WebImageDefinition InternalCode="Default" Title="Default"><SizeConstraint Mode="FreeSize">
                             <FixedSizeData Size="400, 300"></FixedSizeData>
                             <FixedAspectRatioSizeData Size="400, 300" LimitedDimension="Width">
                               <Limits>
                                 <LowLimit Enabled="False" Value="300"></LowLimit>
                                 <HiLimit Enabled="False" Value="400"></HiLimit>
                               </Limits>
                             </FixedAspectRatioSizeData>
                             <FreeSizeData>
                               <LimitsW>
                                 <LowLimit Enabled="False" Value="300"></LowLimit>
                                 <HiLimit Enabled="False" Value="400"></HiLimit>
                               </LimitsW>
                               <LimitsH>
                                 <LowLimit Enabled="False" Value="300"></LowLimit>
                                 <HiLimit Enabled="False" Value="400"></HiLimit>
                               </LimitsH>
                             </FreeSizeData>
                             </SizeConstraint>
                             <OutputOptions FormatMode="Custom" Format="b96b3cae-0728-11d3-9d7b-0000f81ef32e" JPEGQuality="92" JPEGForceRecompression="False"></OutputOptions>
                             </Radactive.WebControls.ILoad.Configuration.WebImageDefinition></WebImageDefinitions><WindowsAppearance><ImageUploadWizardWindow WindowTitle="RADactive I-load" TopLogoImageUrl="" ShowWelcomePage="True" ShowSummaryPage="True" WelcomePageText="" ShowImagePreviewBeforeFileUpload="True" ShowSaveButtonDuringImageEdit="True" CropperCanvasColor="White" HTMLCropperCanvasColor="White" AutoZoomCropperView="True"></ImageUploadWizardWindow><PreviewWindow WindowTitle="RADactive I-load - Preview" AllowImageDownload="True" AllowImagePrint="True"></PreviewWindow></WindowsAppearance><InputOptions><UploadableFileSizeLimits><LowLimit Enabled="False" Value="1"></LowLimit><HiLimit Enabled="False" Value="2097152"></HiLimit></UploadableFileSizeLimits><SourceImageSizeLimitsW><LowLimit Enabled="False" Value="300"></LowLimit><HiLimit Enabled="False" Value="400"></HiLimit></SourceImageSizeLimitsW><SourceImageSizeLimitsH><LowLimit Enabled="False" Value="300"></LowLimit><HiLimit Enabled="False" Value="400"></HiLimit></SourceImageSizeLimitsH><FileExtensionValidator DefaultBehavior="AcceptAll" AcceptedFileExtensions="" NotAcceptedFileExtensions=""></FileExtensionValidator></InputOptions><ImageCropperOptions AllowImageResize="True" AllowImageZoom="True" AllowImageRotate="True" AllowImageFlip="True"></ImageCropperOptions></Configuration></RAWCIL:ILoad>            
                                       
                                        <div style="text-align:middle" id="ILoad1_Image2" class="ILoad_CustomAppearance_DivImage"
                                            onmouseover="this.className='homeimghover'" onmouseout="this.className='ILoad_CustomAppearance_DivImage'">
                                        </div>


The screen shot for the error message is attached below. Please reply ASAP.


Thanks in Advance
Anju S Chandran


Kamen Bundev
Telerik team
 answered on 04 Dec 2010
1 answer
153 views
Is there any sort of demo somewhere on a Fixed position dock bottom implementation of the RadToolBar (that works on IE6?...since it can't do fixed)

Or should I look elsewhere...
Kamen Bundev
Telerik team
 answered on 04 Dec 2010
1 answer
106 views
Hello,

I have some pages with a significant amount of Telerik controls which can sometimes take 2-4 seconds to load in Firefox. I have noticed that sometimes, if the user mouses over a Telerik control on the page before it has been completely loaded (before FormDecorator styles have been applied), the page will throw a javascipt error in

Sys.Application.add_init(function()  $create(Telerik.Web.UI.RadToolBar, {"_cssClass":"","_rawPostBackReference":"WebForm_DoPostBackWithOptions(new WebForm_PostBackOptions
 ...
 });

The error says "[Client-side event handler function name] is undefined" and then the page completely pukes and I cannot interact with any controls. I was wondering if this issue has ever been seen before and if there is a solution for it.

Thanks
Kamen Bundev
Telerik team
 answered on 04 Dec 2010
1 answer
166 views
We have a situation where users can filter a grid, using custom code that sets the mastertableview.filterexpression value, but can then choose to edit or drill down.

What I'd like to do is to restore the most recent filter settings when the user returns to the page. Ideally I'd also like to restore the dropdown and textbox values in my form, but that's secondary.

Does the Grid provide any mechanism to do that? If not, any suggestions about a best-practices approach?

Thanks in advance.
Shinu
Top achievements
Rank 2
 answered on 04 Dec 2010
6 answers
241 views
Hi there,

I am using edit mode of type PopUp for doing update/insert using radgrid. i have used OnUpdateCommand="RadGrid1_UpdateCommand" event and defined it on code behind. but when i click on update button on popup form after modifying text fields, my update command event is not triggering and page shows like it got updated even though not. please anyone provide me solution. Delete works fine and delete event triggers as normal so problem is only with edit update event.  here is a part of my code,

<telerik:RadGrid ID="RadGrid1" AllowSorting="true" AllowPaging="true" 
PageSize="10" AutoGenerateColumns="false" runat="server" OnUpdateCommand="RadGrid1_UpdateCommand"   
OnDeleteCommand="RadGrid1_DeleteCommand" AllowAutomaticUpdates="false">
<MasterTableView DataKeyNames="i_UserId" 
EditMode="PopUp" AllowFilteringByColumn="True" Width="100%" TableLayout="Auto">
    <Columns>
        <telerik:GridBoundColumn 
Visible="False" UniqueName="FirstName"   HeaderText="First Name" DataField="s_FirstName" EditFormColumnIndex="0">                                            
        </telerik:GridBoundColumn> 
        <telerik:GridBoundColumn 
Visible="False" UniqueName="FirstName"   HeaderText="First Name"<BR> DataField="s_FirstName" 
                    EditFormColumnIndex="0"><BR>                                            
        </telerik:GridBoundColumn>
    <Columns/>
    <EditFormSettings 
ColumnNumber="3" CaptionFormatString="Edit details for User: {0}" 
        EditFormType="AutoGenerated" PopUpSettings-Width="70%" PopUpSettings-Modal="true" 
        EditColumn-Resizable="true"  PopUpSettings-ScrollBars="Auto" CaptionDataField="s_Name">                                                
    <FormTableItemStyleWrap="true"></FormTableItemStyle><BR>                                                
    <FormCaptionStyle CssClass="EditFormHeader" ForeColor="Blue"></FormCaptionStyle>                                               
    <FormMainTableStyle GridLines="Both" CellSpacing="0" CellPadding="3" Width="100%" HorizontalAlign="Justify"/>                                               
    <FormTableStyle GridLines="None" CellSpacing="2" CellPadding="2" CssClass="module" Height="110px"/>                                               
    <FormTableAlternatingItemStyle Wrap="False"></FormTableAlternatingItemStyle>                                                
    <FormStyle Width="100%" BackColor="#eef2ea"></FormStyle><BR>                                                
    <EditColumn UpdateText="Update record" ButtonType="PushButton" UniqueName="EditCommandColumn1" CancelText="Cancel edit">                                                
    </EditColumn><BR>                                                
    <FormTableButtonRowStyle HorizontalAlign="Center" ForeColor="Blue" CssClass="EditFormButtonRow"></FormTableButtonRowStyle>                                                                                      
    </EditFormSettings><BR>                                            
    <ExpandCollapseColumn ButtonType="ImageButton" Visible="False" UniqueName="ExpandColumn"><BR>                                                
    <HeaderStyle Width="15px"></HeaderStyle><BR>                                            
    </ExpandCollapseColumn>
  </MasterTableView> 
</
telerik:RadGrid>

And my code behind looks ike this,
      protected void RadGrid1_UpdateCommand(object sender, Telerik.Web.UI.GridCommandEventArgs e)
        {
            GridEditableItem editedItem = e.Item as GridEditableItem;  
            int intUserId = Convert.ToInt32(editedItem.OwnerTableView.DataKeyValues[editedItem.ItemIndex]["i_UserId"].ToString());
            string strLastName = (editedItem["LastName"].Controls[0] as TextBox).Text;
            string strFirstName = (editedItem["FirstName"].Controls[0] as TextBox).Text; 
            ..........
            ..........
            ...........
            }

When debug this, control doesnt move to the above block when i click on upadte button.


Thanks & Regards,
Ash
Ash
Top achievements
Rank 1
 answered on 04 Dec 2010
1 answer
228 views
I'm almost there on this solution. I have a RadGrid that I received assistance with to create RadioButtons in the columns so that only one row value can be selected at a time per column. This works perfectly and now I'm trying to submit the results using an external button so that the values can be saved in the database. All of the rows are put into edit mode when the page loads. The problem is that the update command is only firing for the first row using my code...

Here is the code for the external button
protected void btn_submit_Click(object sender, EventArgs e)
{
    GridItem[] items = RadGrid1.MasterTableView.GetItems(GridItemType.EditItem);
 
    for (int i = 0; i < items.Length; i++)
    {
        int itemIndex = items[i].ItemIndex;
        if (RadGrid1.EditItems[i].ItemIndex == itemIndex)
        {
            (items[i] as GridEditableItem).FireCommandEvent("Update", String.Empty);
        }
    }
 
    RadGrid1.EditIndexes.Clear();
    for (int i = 0; i < RadGrid1.PageSize; i++)
        RadGrid1.EditIndexes.Add(i);
    RadGrid1.Rebind();
}


If I change this line...
if (RadGrid1.EditItems[i].ItemIndex == itemIndex)

so that "i" is the row index I want to submit, I can get the values to submit for that particular row.

I'm not sure why the for loop stops after the first run through though. Using this code, shouldn't it fire off the Update command for each row that it finds? I checked the value of items.Length and got 8 (which is correct...there are 8 rows), so it should run this 8 times and fire off the Update command for row indexes 0-7.

Let me know if I'm not understanding how this works properly...thanks =)
Shinu
Top achievements
Rank 2
 answered on 04 Dec 2010
3 answers
176 views

I am migrating RadTabStrip from older classic  to new Ajax supported version .In the code we are not using css file but used Skin="Outlook".
In new page now its giving extra padding around the text . Attached is the image showing difference between older and new UI.

I have tried following lines of code in css file but still padding is not removed.

.RadTabStrip

 

.rtsOut,

 

.RadTabStrip

 

.rtsTxt,

 

.RadTabStrip

 

.rtsLI,

 

.RadTabStrip

 

.rtsLink,

 

.RadTabStrip

 

.rtsIn {

 

 

padding:0px 0px 0px 0px;

 

 

margin:0px 0px 0px 0px;

 

 

font-size:10px;

 

 

/*background-color:Red;*/

 

 

}


Shinu
Top achievements
Rank 2
 answered on 04 Dec 2010
4 answers
98 views
Not sure if this is even possible with RadGrid, but I thought I'd put it out there to see if this is something that it can do...

I'm trying to create a selection grid where each row would have a person's name in the first column, and then 5 columns representing categories. A person can be selected for more than one category, but a category can only have one person selected.

In trying to think this through, the first thought was that the entire grid would have to put into edit mode with in-place editing...that seems simple enough to figure out. The next thought was how to create a column where the selection in one row de-selects the other rows. Finally, I would need a button that would submit all the rows on the grid.

Do you think this is something that RadGrid can do or should I be looking for a different solution for this type of functionality?

Thanks =)
Philip Senechal
Top achievements
Rank 1
 answered on 03 Dec 2010
1 answer
67 views
Disregard. . .stupid error on my part.
John Husted
Top achievements
Rank 1
 answered on 03 Dec 2010
7 answers
239 views
Hi! I'm working on a dashboard type web page. I require several RadGrids on it. Now, with all the grids, the page is pretty long in Y-axis. I need to have the grid's collapse using it's caption bar (if possible). I'm in no mood to use AjaxTool:RoundedCornersExtender at this stage. Kindly suggest a way to accomplish this.
DoomerDGR8
Top achievements
Rank 2
Iron
Iron
Iron
 answered on 03 Dec 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jake
Top achievements
Rank 1
RBarnes
Top achievements
Rank 1
Iron
Iron
Rami
Top achievements
Rank 1
Iron
Veteran
Nathan
Top achievements
Rank 1
Kumeri
Top achievements
Rank 1
Iron
Veteran
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?