Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
87 views
I have a RADGrid with update capability-the INSERT and UPDATE done through a user control.  I have a pair of checkboxes on the main form which affect the processing.  How do I pass the values of these checkboxes into the user control (or access them from the user control code behind)?
Elliott
Top achievements
Rank 2
 answered on 23 May 2011
2 answers
104 views
Hello Everyone,
                        I used Radupload in my webpage.and insert multiple docs in database..but when i refresh this page insert previous data automatically....if anyone has solution give it..

Thanks..

My Code is Here...
  <telerik:RadScriptManager id="ScriptManager1" runat="server" />
        
          
            
            <telerik:RadProgressManager id="Radprogressmanager1" runat="server" />
            
            <div style="position: relative;">
                <table>
                 <tr>
                        <td id="controlContainer">
                            <telerik:RadUpload
                                ID="RadUpload1"
                                runat="server"
                                InitialFileInputsCount="1"
                                MaxFileInputsCount="5"
                                AllowedFileExtensions=".jpg,.jpeg"  ControlObjectsVisibility="None" />
                                
                            <telerik:RadProgressArea id="progressArea1" runat="server"/>
                            <asp:Button id="buttonSubmit" runat="server" CssClass="RadUploadSubmit" OnClick="buttonSubmit_Click" Text="Submit" style="MARGIN-TOP: 6px" />
                        </td>
                        <td>
                            <div class="smallModule">
                                <div class="rc1"><div class="rc2"><div class="rc3" style="width:240px">
                                    <div class="title" style="color: green">Uploaded valid files (*.jpg, *.jpeg):</div>
                                    
                                    <asp:Label ID="labelNoResults" runat="server" Visible="True">No uploaded files</asp:Label>
                                    
                                    <asp:Repeater ID="repeaterValidResults" runat="server" Visible="False">
                                        <ItemTemplate>
                                            <%#DataBinder.Eval(Container.DataItem, "FileName")%>
                                            (<%#DataBinder.Eval(Container.DataItem, "ContentLength").ToString() + " bytes"%>)<br /><br />
                                        </ItemTemplate>
                                    </asp:Repeater>
                                    
                                    
                                    <div class="title" style="color: red; padding-top: 40px;">Invalid files:</div>
                                    
                                    <asp:Label id="labelNoInvalidResults" runat="server" Visible="True">No invalid files</asp:Label>
                                    
                                    <asp:repeater id="repeaterInvalidResults" runat="server" visible="False">
                                        <itemtemplate>
                                            File: <%#DataBinder.Eval(Container.DataItem, "FileName") %>
                                            (<%#DataBinder.Eval(Container.DataItem, "ContentLength").ToString() + " bytes"%>)
                                            <br />
                                            Mime-type: <%#DataBinder.Eval(Container.DataItem, "ContentType").ToString()%>
                                        </itemtemplate>
                                    </asp:repeater>
                                </div></div></div>
                            </div>
                        </td>
                    </tr>
                 </table>
            </div>


and .cs file coding

 protected void buttonSubmit_Click(object sender, System.EventArgs e)
    {
        
            BindValidResults();
      
            BindInvalidResults();

            //Remove this line if you do not want to delete the files
            //in the location where they have been saved
            DeleteFiles();
            //RadUpload1.UploadedFiles.Clear();
            //int j = RadUpload1.UploadedFiles.Count;
          
       
    }

    private void BindValidResults()
    {
        if (RadUpload1.UploadedFiles.Count > 0)
        {
            //foreach (UploadedFile validFile in RadUpload1.UploadedFiles)
            //{
            //    string targetFolder = Server.MapPath("~/images/");
            //    validFile.SaveAs(Path.Combine(targetFolder, validFile.GetName()), true);
            //}
            for (int i = 0; i < RadUpload1.UploadedFiles.Count; i++)
            {
                FileName = RadUpload1.UploadedFiles[i].FileName.ToString();
                pa = "~/images/" + FileName;
                string fad = Server.MapPath("images/" + RadUpload1.UploadedFiles[i].FileName.ToString());
                RadUpload1.UploadedFiles[i].SaveAs(fad);
                // string va = "~/" + ;

                string str = "insert into generaldocuments(Doc,date) values('" + pa + "','" + System.DateTime.Today.Date.ToShortDateString() + "')";
                int j = obj.FireQuery(str);

            }
            labelNoResults.Visible = false;
            repeaterValidResults.Visible = true;
            repeaterValidResults.DataSource = RadUpload1.UploadedFiles;
            repeaterValidResults.DataBind();
        }
        else
        {
            labelNoResults.Visible = true;
            repeaterValidResults.Visible = false;
        }
    }

    private void BindInvalidResults()
    {
        if (RadUpload1.InvalidFiles.Count > 0)
        {
            labelNoInvalidResults.Visible = false;
            repeaterInvalidResults.Visible = true;
            repeaterInvalidResults.DataSource = RadUpload1.InvalidFiles;
            repeaterInvalidResults.DataBind();
        }
        else
        {
            labelNoInvalidResults.Visible = true;
            repeaterInvalidResults.Visible = false;
        }
    }

    /// <summary>
    /// For the purpose of this demo we delete the files collection in the targetfolder
    /// to prevent it from growing infinitely
    /// </summary>
    private void DeleteFiles()
    {
        string targetFolder = Server.MapPath("~/images/");

        DirectoryInfo targetDir = new DirectoryInfo(targetFolder);

        try
        {
            foreach (FileInfo file in targetDir.GetFiles())
            {
                if ((file.Attributes & FileAttributes.ReadOnly) == 0) file.Delete();
            }
        }
        catch (IOException)
        {
        }
    }
dhara
Top achievements
Rank 1
 answered on 23 May 2011
5 answers
113 views
hI

im adding data to rad combo using the below Script  client script

Group.trackchanges();
for(var myproduct=selDivision.nextNode();myproduct;myproduct=selDivision.nextNode()){

 

var

 

comboItem1= new Telerik.Web.UI.RadComboBoxItem();

 

if

 

(selOldUnit==myproduct.attributes(0).value){

 

 

comboItem1.set_value(myproduct.attributes(0).value);

 

comboItem1.set_text(myproduct.text);

 

Group.get_items().add(comboItem1);

 

comboItem.select();

 

}
Group.commitchages();

the same code for ASP Drop down is add data fastly.. please help me fixing this

how to set integral height true is Sourec Code

Thanks
Harin


Dimitar Terziev
Telerik team
 answered on 23 May 2011
5 answers
171 views
hi,

My Browser is IE8. I am using comboBox like that;

<telerik:RadComboBox ID="rcbEquipmenList" runat="server" Width="300px" Height="150px"
                EmptyMessage="Malzeme Seçiniz" EnableLoadOnDemand="True" ShowMoreResultsBox="true"
                EnableVirtualScrolling="true" OnItemsRequested="rcbEquipmenList_ItemsRequested">
            </telerik:RadComboBox>

When I convert my scriptmanager EnableHistory propert TRUE, then OnItemsRequested not fired. On chrome and mozilla it is working very well. but on IE8  not work. if I close EnableHistory false then it is working.. 

Conditions;

first click combobox. you will see, the data is coming. then click button and postback , add history property. After that click again combobox, the data not come.. 

<form id="form1" runat="server">
<div>
    <asp:ScriptManager runat="server" ID="ddd" EnableHistory="true" AsyncPostBackTimeout="30">
    </asp:ScriptManager>
 
    <telerik:RadAjaxPanel ID="pmnl" runat="server">
        <telerik:RadComboBox ID="rcbEquipmenList" runat="server" Width="300px" Height="150px"
            EmptyMessage="Malzeme Seçiniz" EnableLoadOnDemand="True" ShowMoreResultsBox="true"
            EnableVirtualScrolling="true" OnItemsRequested="rcbEquipmenList_ItemsRequested">
        </telerik:RadComboBox>
 
        <asp:Button id="dd" runat="server" onclick="dd_Click" ></asp:Button>
    </telerik:RadAjaxPanel>
</div>
</form>

private const int ItemsPerRequest = 20;
   protected void rcbEquipmenList_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
   {
       //Random r = new Random(1000);
       //string s = r.Next().ToString();
       //ddd.AddHistoryPoint(s, "dd");
       List<string> lst = new List<string>();
       lst.Add("111");
       lst.Add("2222");
       lst.Add("333");
       lst.Add("444");
       lst.Add("555");
       lst.Add("66");
       lst.Add("77");
       lst.Add("88");
       lst.Add("9999");
       lst.Add("100");
       lst.Add("111");
       lst.Add("122");
       lst.Add("1333"); lst.Add("2222");
       lst.Add("333");
       lst.Add("444");
       lst.Add("555");
       lst.Add("66");
       lst.Add("77");
       lst.Add("88");
       lst.Add("9999");
       lst.Add("100");
       lst.Add("111");
       lst.Add("122");
       lst.Add("1333"); lst.Add("2222");
       lst.Add("333");
       lst.Add("444");
       lst.Add("555");
       lst.Add("66");
       lst.Add("77");
       lst.Add("88");
       lst.Add("9999");
       lst.Add("100");
       lst.Add("111");
       lst.Add("122");
       lst.Add("1333");
 
       int itemOffset = e.NumberOfItems;
       int endOffset = Math.Min(itemOffset + ItemsPerRequest, lst.Count);
       e.EndOfItems = endOffset == lst.Count;
 
       for (int i = itemOffset; i < endOffset; i++)
       {
           rcbEquipmenList.Items.Add(new RadComboBoxItem(lst[i], lst[i]));
       }
   }
   protected void dd_Click(object sender, EventArgs e)
   {
       Random r = new Random(1000);
       string s = r.Next().ToString();
       ddd.AddHistoryPoint(s, "dd");
   }
Simon
Telerik team
 answered on 23 May 2011
3 answers
108 views
I have two questions regarding the grid.  One is a problem and the other is a "how to" or "can I".

(1) I have a grid which is used to page through search results (refer to attached graphic radgridquestion1.png).  The first page of the grid displays just fine, but when I click on the grids 'next' button, the page is displayed with nothing but blank space where the grid was on the first page (refer to attached graphic radgridquestion2.png).  The following code is the definition of the grid in the .aspx file.

<telerik:RadGrid ID="RadGrid1" runat="server" EnableEmbeddedSkins="true" Skin="Sitefinity" ShowHeader="false" AllowPaging="True" PageSize="5" Height="700px" >
    <PagerStyle Mode="NextPrevAndNumeric" />
    <MasterTableView TableLayout="Fixed">
        <ItemTemplate>
            <table>
                <tr>
                    <td>
                        <asp:Image ID="Image1" Style="float: left;" Width="150px" Height="100px" ImageUrl='<%# Eval("PicturePath")%>'
                            BorderWidth="1px" runat="server" AlternateText="Stock Image" />
                    </td>
                    <td>
                           
                    </td>
                    <td>
                        <div>
                            <ul>
                                <li>
                                    <%# Eval("ListingStreetAddress")%>
                                </li>
                                <li>
                                    <label>Beds:</label><%# Eval("Bedrooms")%>
                                </li>
                                <li>
                                    <label>Baths:</label><%# Eval("Bathrooms")%>
                                </li>
                                <li>
                                    <label>Price:</label><%# Eval("ListingPrice")%>
                                </li>
                            </ul>
                        </div>
                    </td>
                </tr>
            </table>
        </ItemTemplate>
    </MasterTableView>
    <ClientSettings AllowDragToGroup="false">
        <Scrolling AllowScroll="true" UseStaticHeaders="false" />
    </ClientSettings>
</telerik:RadGrid>

Obviously, I don't understand why the second page won't display.  Any ideas or assistance would be greatly appreciated!

(2) A "how to" question:  In the first attached graphic, you can see search criteria in the left-most column, the grid containing results in the middle column, and the right-most column is blank.  I will be putting a small Google map in this space and want it to only contain "push pins" for the properties displayed in the current page of the grid.  Is there a way I can do this?  How and in what grid event would I be able to put the code to add the "push pins" each time a new grid page is displayed?  In what event would I place the code to "clear the map" to ready it for the next n number pins?  Feel free to ask questions if I did not explain myself adequately.

Thanks in advance for your help.  I know the attached page still looks a little rough, but it's still a work in progress!

Thanks again!

Lynn
Daniel
Telerik team
 answered on 23 May 2011
2 answers
129 views
 Radfilter.rootgroup.expression.clear()   this work at server side.

is there any way to clear rootgroupexpression at client side by java script.

Thanks
Bharat Veer
bharat veer
Top achievements
Rank 1
 answered on 23 May 2011
1 answer
92 views
I just wanted to make everyone aware of a small mistype in the documentation for ASP.NET AJAX Q1 2011 SP1.

In an examples listed you have:

protected void HandleNodeEdit(object sender, RadTreeNodeEventArgs NodeEvents)
{            
    RadTreeNode nodeEdited = NodeEvents.NodeEdited;
    string newText = NodeEvents.NewText;

    nodeEdited.Text = newText;
}

which, of course, should be RadTreeNodeEditEventArgs.

URL to the help page is below.

http://127.0.0.1:47873/help/1-7288/ms.help?method=page&id=P:TELERIK.WEB.UI.RADTREEVIEW.ALLOWNODEEDITING&product=TELERIK_RC_AJAX&productversion=2011_Q1&locale=en-US&topiclocale=EN-US&topicversion=100&SQM=2


Kate
Telerik team
 answered on 23 May 2011
1 answer
79 views
Hi there,

Is there a control I can use which will show a loading image as part of a list? For example, I want to show the progress of multiple actions in the following format:

<green tick>    Syncing Item A
<red X>    Syncing Item B
<loading image here>    Syncing Item C

Basically, a loading image needs to be displayed next to the item which is currently being synced. When an item has been successfully synced, a green tick needs to show next to the item. If an error occurs with the sync, I want to show a red X.
Pavlina
Telerik team
 answered on 23 May 2011
2 answers
79 views
Hi,

I have a problem with RadMenuItem,

My Question is, I have created one RadMenu with RadMenuItems, where the RadMenuItems will display in horizontal direction.

Up to now it is working fine, but when i click on outside of RadMenu, the RadMenuItems are not displaying

How to display the RadMenuItems continuously ...


Please help me..
Naresh
Top achievements
Rank 1
 answered on 23 May 2011
6 answers
264 views
Hello
I have telerik:RadListBox.  I have a tooltip manager .
<telerik:RadToolTipManager runat="server" ID="radTTMgr" CssClass="prodOPB" Position="BottomRight" RelativeTo="Element"
    Width="180px" Height="100px" Animation="Fade" ShowCallout="false" OffsetX="-70" OffsetY="-1"
    ShowDelay="0" ShowEvent="OnClick" OnAjaxUpdate="OnAjaxUpdate" Skin="MySkin" HideEvent="LeaveTargetAndToolTip"       
    EnableEmbeddedSkins="false" >
</telerik:RadToolTipManager>

On RadListBox OnItemDataBound  I add controls to target controls collection
Control image = e.Item.FindControl("imgMenu");
this.radTTMgr.TargetControls.Add(image.ClientID, e.Item.DataKey.ToString(), true);

Everything is working fine except one minor thing that needs to be adjusted. When I do following sequence tooltip closes
1.   Click on target
2.   Move mouse to tooltip
3.   Move back to target and tooltip disappears.
At the same time as I do step 3 my ListItem is getting a “hover” class, so I’m wondering if that’s what causes my issue. I tried to use OnClientBeforeHide  to cancel close if my mouse is over target control but I could not figure that out. Can you please help
Thank you
Svetlina Anati
Telerik team
 answered on 23 May 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Jay
Top achievements
Rank 3
Bronze
Iron
Iron
yw
Top achievements
Rank 2
Iron
Iron
Stefan
Top achievements
Rank 2
Iron
Iron
Iron
Kao Hung
Top achievements
Rank 1
Iron
Bohdan
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?