Telerik Forums
UI for ASP.NET AJAX Forum
2 answers
205 views
Hi,
I am using one rad grid 

 

 

<

telerik:RadGrid ID="RadGrid1" runat="server" AutoGenerateColumns="false" Skin="Office2007" AutoGenerateEditColumn="false" 

 

 

OnNeedDataSource="NeedData" AllowAutomaticInserts="True" AllowAutomaticUpdates="True" 

 

 

OnInsertCommand="Insert" OnUpdateCommand="Update"> 
<MasterTableView CommandItemDisplay="TopAndBottom"> 

 

 

<Columns> 

 

 

<telerik:GridTemplateColumn UniqueName="Attribute"> 

 

 

<ItemTemplate> 

 

 

<asp:Label ID="Label1" runat="server" Text='<%# Bind( "Attribute" ) %>'></asp:Label> 

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn> 

 

 

<telerik:GridTemplateColumn UniqueName="Val"> 

 

 

<ItemTemplate> 

 

 

<asp:Label ID="Label2" runat="server" Text='<%# Bind( "Val" ) %>'></asp:Label> 

 

 

</ItemTemplate>

 

 

</telerik:GridTemplateColumn> 

 

 

 

<telerik:GridEditCommandColumn HeaderText="Action"> 

 

 

</telerik:GridEditCommandColumn> 

 

 

</Columns> 

 

 

<EditFormSettings EditFormType="Template"> 

 

 

<FormTemplate> 

 

 

<asp:TextBox ID="txtAttribute" runat="server" Text='<%# Bind( "Attribute" ) %>'></asp:TextBox> 

 

 

<asp:TextBox ID="txtVal" runat="server" Text='<%# Bind( "Val" ) %>'></asp:TextBox> 

 

 

 

<asp:Button ID="btnUpdate" Text='<%# (Container is GridEditFormInsertItem) ? "Insert" : "Update" %>' 

 

 

runat="server" CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert" : "Update" %>'> 

 

 

</asp:Button>&nbsp; 

 

 

<asp:Button ID="btnCancel" Text="Cancel" runat="server" CausesValidation="False" 

 

 

CommandName="Cancel"></asp:Button> 

 

 

</FormTemplate> 

 

 

</EditFormSettings> 

 

 

</MasterTableView> 

 

 

</telerik:RadGrid>

 

 

 

Now how to hide the edit form after the Insert ? like the cancel

 

protected

void Insert(object source, GridCommandEventArgs e)

 

{

// some code

} 

please help, it is very urgent.

arijit
Top achievements
Rank 1
 answered on 10 Sep 2009
3 answers
196 views
I currently have a listbox being populated from the client side. each time an ajaxfied timer ticks on the server side. I am wanting to always have the listbox scroll or stay scrolled at the bottom. The list box contains a list of messages from the server. and i am wanting the last message to always be visible which when i add it to listbox it is placed at the bottom.

any idea is appreciated
Veselin Vasilev
Telerik team
 answered on 10 Sep 2009
1 answer
184 views
I am trying to use the radupload control, and am having trouble connecting the "submit" button to the control.

After looking a the demos for this control, I can not see where the button is tied into the upload.

It would appear that the button click is simply toggling the visibility of labels and such.

How is the filexists fired? What controls it if I have multiple buttons in my page?

Obviously I am missing something here, any help would be greatly appreciated.

How does the code below trigger the file to be uploaded on the click of the button?


<telerik:RadUpload
                            ID="RadUpload1" runat="server"
                            MaxFileInputsCount="5"
                            TargetFolder="~/Upload/Examples/UsingTargetFolder/MyFiles"
                            OverwriteExistingFiles="false" />




<asp:Button id="buttonSubmit" runat="server" CssClass="RadUploadSubmit" OnClick="buttonSubmit_Click" text="Submit" />

 Protected Sub buttonSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs)
            If RadUpload1.UploadedFiles.Count > 0 Then
                repeaterResults.DataSource = RadUpload1.UploadedFiles
                repeaterResults.DataBind()
                labelNoResults.Visible = False
                repeaterResults.Visible = True
            Else
                labelNoResults.Visible = True
                repeaterResults.Visible = False
            End If
            DeleteFiles()
        End Sub


Protected Sub RadUpload1_FileExists(ByVal sender As Object, ByVal e As Telerik.Web.UI.Upload.UploadedFileEventArgs)
            Dim counter As Integer = 1
            Dim file As UploadedFile = e.UploadedFile
            Dim targetFolder As String = Server.MapPath(RadUpload1.TargetFolder)
            Dim targetFileName As String = Path.Combine(targetFolder, file.GetNameWithoutExtension() + counter.ToString() + file.GetExtension())
            While System.IO.File.Exists(targetFileName)
                System.Math.Max(System.Threading.Interlocked.Increment(counter),counter - 1)
                targetFileName = Path.Combine(targetFolder, file.GetNameWithoutExtension() + counter.ToString() + file.GetExtension())
            End While
            file.SaveAs(targetFileName)
        End Sub


Veselin Vasilev
Telerik team
 answered on 10 Sep 2009
2 answers
365 views

Hello;
I need to transfer items from one RadListBox to another RadListBox using client-side programming and both list boxes has item templates. I’ve noticed that the item is not moved correctly in that case unlike the case when the list box items do not have template.

 

Any help?

 

Here is the code snippet:

 

<table border="0" cellpadding="10" cellspacing="0">

        <tr>

            <td width="50%" align="center">

                <telerik:RadListBox runat="server" ID="rlb1" TransferMode="Move" SelectionMode="Single" AutoPostBack="true"

                    OnClientSelectedIndexChanged="selectedIndexChanged" Width="200px" Height="150px" DataTextField="Header" DataValueField="Header">

                    <ItemTemplate>

                        <asp:Image runat="server" ImageUrl="~/images/plus_009.gif" />&nbsp;<asp:Label runat="server" Text='<%# Eval("Header") %>' />

                    </ItemTemplate>

                </telerik:RadListBox>

            </td>

            <td align="center">

                <telerik:RadListBox runat="server" ID="rlb2" TransferMode="Move" SelectionMode="Single" Width="200px" Height="150px"

                    DataTextField="Header" DataValueField="Header">

                    <ItemTemplate>

                        <asp:Image runat="server" ImageUrl="~/images/plus_009.gif" />&nbsp;<asp:Label runat="server" Text='<%# Eval("Header") %>' />

                        &nbsp;<asp:Label runat="server" Text='<%# Eval("Desc") %>' />

                    </ItemTemplate>

                </telerik:RadListBox>

            </td>

        </tr>

    </table>

 

 

<telerik:RadScriptBlock runat="server">

<script language="javascript" type="text/javascript">

    function selectedIndexChanged(sender, args) {

        var listSource = $find("<%= rlb1.ClientID %>");

        var selectedItem = listSource.get_selectedItem();

 

        listSource.trackChanges();

 

        var listDest = $find("<%= rlb2.ClientID %>");

        //var item = new Telerik.Web.UI.RadListBoxItem();

        //item.set_text(selectedItem.get_text());

        //item.set_value(selectedItem.get_value());

        //var item = selectedItem.clone();

 

        listDest.trackChanges();

        listDest.get_items().add(selectedItem);

        //item.scrollIntoView();

        listDest.commitChanges();

 

        //listSource.get_items().remove(selectedItem);

        listSource.commitChanges();

    }

</script>

</telerik:RadScriptBlock>

 

 

 

Code behind (to fill the list box woth some data):

 

    protected void Page_Load(object sender, EventArgs e)

    {

        if (!Page.IsPostBack)

        {

            rlb1.DataSource = getTable();

            rlb1.DataTextField = "Header";

            rlb1.DataValueField = "Header";

            rlb1.DataBind();

        }

    }

    private DataTable getTable()

    {

        DataTable table = new DataTable();

        table.Columns.Add("Header", typeof(string));

        table.Columns.Add("Desc", typeof(string));

 

        DataRow row;

        #region Insert Data to Row

        row = table.NewRow();

        row["Header"] = "Head1";

        row["Desc"] = "Desc1";

        table.Rows.Add(row);

        #endregion

 

        #region Insert Data to Row

        row = table.NewRow();

        row["Header"] = "Head2";

        row["Desc"] = "Desc2";

        table.Rows.Add(row);

        #endregion

 

        #region Insert Data to Row

        row = table.NewRow();

        row["Header"] = "Head3";

        row["Desc"] = "Desc3";

        table.Rows.Add(row);

        #endregion

 

        #region Insert Data to Row

        row = table.NewRow();

        row["Header"] = "Head4";

        row["Desc"] = "Desc4";

        table.Rows.Add(row);

        #endregion

 

        return table;

    }

 

Genady Sergeev
Telerik team
 answered on 10 Sep 2009
8 answers
423 views
Hello,
I have just downloaded RadControls AJAX Q2 2008. Right after I start receive the error message 'XXXX' is ambiguous in the namespace 'Telerik.Web.UI'. This seems to be occuring on every page and every Rad Control.

Do I need t unstall Prometheus first???  or are there any other suggestions you can provide in correcting this error.

We are moving into Phase II of our project and the Rad controls have been a big hit so far.

Look forward to reading your reply.

 

Jay P. Hayes (MCTS SQL 2005)
Colonial Properties Trust (One CLP)
O – 205.795-8120
C – 205-789-1970

Sebastian
Telerik team
 answered on 10 Sep 2009
1 answer
112 views
Dear Sirs,
I am using the RadRotator to show some images (640x480).
The ItemTemplate is a DIV with an image inside (no CSS applied).
The rotator type is "buttons", Width and ItemWidth are 320 while Height and ItemHeight are 240.
Scroll direction is left and right.
The strange thing is that between the images a space is shown, like if it didn't slide of the correct wiidth.
In this way, after scrolling to the left at every time the images are not centered, but shifted of a delta with respect of the margins.
Why is that?
Thank you very much for your help.
Best regards.
Sergio
Georgi Tunev
Telerik team
 answered on 10 Sep 2009
1 answer
232 views
Could someone give me an example of a nested grid using the NeedDataSource event that takes datakey from the parent grid? I don't want to use the SqlDatasource. Also where would I register this event? It seems that just setting the nested grids OnNeedDataSource attrib doesn't do it.

Thanks
Rocky
Shinu
Top achievements
Rank 2
 answered on 10 Sep 2009
3 answers
95 views
I am trying to set this up where I am on a details page and it opens up a new window, and inside the opened radwindow, I can add more items to the cart. However, I don't want the radwindow to close on me, I just want it to refresh the page without creating a new radwindow within itself. Kind of gives you the mirror effect, which may be cool, just doesn't look as cool to an end user.

Georgi Tunev
Telerik team
 answered on 10 Sep 2009
3 answers
117 views
I am trying to get radEditor to show a custom Icon in the tool bar and am having no luck.  The issue is I am clueless as how CSS works!

Here is what I have
ASPX Code

<

 

telerik:RadEditor ID="reBody" Runat="server" Width="900px"

 

 

 

    ToolsFile="toolsfile.xml" OnClientCommandExecuting="OnClientCommandExecuting">

 

 

 

   <Tools>

 

 

 

       <telerik:EditorToolGroup >

 

 

 

          <telerik:EditorTool Name="InsertOEMInterchange" Text="Insert OEM Interchange List" />

 

 

 

       </telerik:EditorToolGroup>

 

 

 

     </Tools>

 

 

 

   <Content>

 

 

     </

 

Content>

 

 

 

</

 

telerik:RadEditor>

The Icon Image is located at 

 

 

/APP_Themes/Skins/Default/Editor/OEMInterchange.gif



I have tried placing this CSS code (and other variants!)

 

.rade_toolbar.Default

 

 

.InsertHollInterchange

 

 

 

 

{

 

 

 

background-image: url('Editor/OEMInterchange.gif')!important;

 

}

 

 

.rade_toolbar.Default .InsertOEMInterchange

 

 

 

 

{

 

 

 

background-image: url('Editor/OEMInterchange.gif')!important;

 

}

 

 

.reTool .InsertHollInterchange

 

 

 

 

{

 

 

 

background-image: url('Editor/OEMInterchange.gif')!important;

 

}

 

 

.reTool .InsertOEMInterchange

 

 

 

 

{

 

 

 

background-image: url('Editor/OEMInterchange.gif')!important;

 

}

in the Following CSS files

 

 

    /App_Themes/Skins/Editor.css
    /App_Themes/Skins/Default/Editor.css

The editor is set for the Default skin.

This is on a master / content page.

I also stuck this in the master and the content page.
<style type="text/css">

 

 

 

 

.reToolbar.Default.InsertOEMInterchange

 

 

 

 

{

 

 

 

background-image: url(../APP_Themes/Skins/Default/Editor/OEMInterchange.gif);

 

}

 

 

 

</style>

But no matter what I do I cannot get the icon to show up.  I really need help!   What am I doing wrong?

Thanks in advance.

 

 

 

 

Martin
Telerik team
 answered on 10 Sep 2009
14 answers
517 views
I have the need to create some charts and display them in DotNetNuke and found that adding a Chart control to a module throws some errors (at this point, can't remember exactly, but some popups about cannot display image, do you want to view the stack trace). 

What I ended up doing as a workaround is created an ASPX page in my dnn module that will handle some querystring values and then dynamically creates a RadChart control, populates the series and all that jazz, and then calls RadChart.Save(this.Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg) (after appropriately clearing the headers and response stream and setting the content type to "image/jpeg").  The processor page is linked to an asp:Image control on the dnn module itself as the image url so it processes and shows up dandy.

What I'm wondering is if this would be "correct" usage for such a scenario or if there is a "better" way to get it working with DNN.
BB Agrawal
Top achievements
Rank 1
 answered on 10 Sep 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?