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

how to make validation for minimum width and minimum height for image before upload on server.

Appreciate for quick response


Yasin
Shinu
Top achievements
Rank 2
 answered on 23 Jul 2014
1 answer
322 views
Hi. I try get item from edit form template, when edit button pressed, to change some of their values.
But I always receive null.
My code:

<telerik:RadGrid ID="RadGrid1" runat="server" AllowSorting="True"
    DataSourceID="sqlDataFeedGrid" GridLines="Both" AllowPaging="True"
    AllowAutomaticUpdates="True" AllowAutomaticInserts="True" AllowAutomaticDeletes="True"
    OnInsertCommand="RadGrid1_InsertCommand"
    OnEditCommand="RadGrid1_EditCommand"
    OnPreRender="RadGrid1_PreRender" OnUpdateCommand="RadGrid1_UpdateCommand">
    <PagerStyle Mode="NextPrevAndNumeric" />
    <MasterTableView DataSourceID="sqlDataFeedGrid" AutoGenerateColumns="False"
        DataKeyNames="Id" CommandItemDisplay="Top">
        <Columns>
            <telerik:GridEditCommandColumn ButtonType="ImageButton" UniqueName="EditCommandColumn" />
            <telerik:GridBoundColumn DataField="Id" HeaderText="Datafeed ID" SortExpression="Id" UniqueName="Id" Visible="False" MaxLength="10" />
            <telerik:GridBoundColumn DataField="IPAddress" DataType="System.String" HeaderText="IP Address" SortExpression="IPAddress" UniqueName="IPAddress" />
            <telerik:GridBoundColumn DataField="Name" DataType="System.String" HeaderText="Name" SortExpression="Name" UniqueName="Name" />
            <telerik:GridBoundColumn DataField="Status" DataType="System.String" HeaderText="Status" SortExpression="Status" UniqueName="Status" />
            <telerik:GridBoundColumn DataField="Configs" DataType="System.Guid" HeaderText="Configs" SortExpression="Configs" UniqueName="Configs" />
            <telerik:GridBoundColumn DataField="Logs" DataType="System.String" HeaderText="Logs" SortExpression="Logs" UniqueName="Logs" />
            <telerik:GridBoundColumn DataField="setupInstruction" DataType="System.Guid" HeaderText="Install Instruction" SortExpression="setupInstruction" UniqueName="setupInstruction" />
            <telerik:GridBoundColumn DataField="execInstruction" DataType="System.Guid" HeaderText="Execute Instruction" SortExpression="execInstruction" UniqueName="execInstruction" />
            <telerik:GridBoundColumn DataField="Description" DataType="System.String" HeaderText="Description" SortExpression="Description" UniqueName="Description" />
            <telerik:GridButtonColumn Text="Delete" CommandName="Delete" ButtonType="ImageButton" />
        </Columns>
        <EditFormSettings EditFormType="Template">
            <EditColumn UniqueName="EditColumn"></EditColumn>
            <FormTemplate>
                <table cellspacing="2" cellpadding="1" width="100%" border="0"
                    rules="none" style="border-collapse: collapse;">
                    <tr class="EditFormHeader">
                        <td colspan="2" style="font-size: small">
                            <b>Datafeed Details</b>
                        </td>
                    </tr>
 
                    <tr>
                        <td></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td>ID</td>
                        <td>
                            <asp:TextBox ID="txtId" runat="server" ValidationGroup="Datafeed" ReadOnly="true" Text='<%# Bind("Id") %>' />
                        </td>
                    </tr>
                    <tr>
                        <td>IP Address
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlMachineId" EnableViewState="true" AutoPostBack="true"
                                runat="server" DataSourceID="sqlMachineId" DataTextField="IPAddress"
                                DataValueField="ID" OnSelectedIndexChanged="ddlMachineId_IndexChange" />
                            <asp:Label ID="lblHostingName" runat="server"></asp:Label>
                        </td>
                    </tr>
                    <tr>
                        <td>Data Agent</td>
                        <td>
                            <asp:DropDownList ID="ddlDataAgentID" runat="server" DataSourceID="sqlDataAgentId" DataTextField="Name" DataValueField="ID">
                            </asp:DropDownList><asp:Button ID="addAgent" runat="server" Text="Add" Width="55px" OnClick="addAgent_Click" />
                            <asp:ListBox ID="agentsList" runat="server" Height="91px" Width="194px"></asp:ListBox>
                        </td>
                    </tr>
                    <tr>
                        <td>Datafeed Name</td>
                        <td>
                            <asp:TextBox ID="txtName" runat="server" ValidationGroup="Datafeed" Text='<%# Bind("Name") %>' />
                        </td>
                    </tr>
                    <tr>
                        <td>Status</td>
                        <td>
                            <asp:TextBox ID="txtStatus" runat="server" ValidationGroup="Datafeed" Text='<%# Bind("Status") %>'></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>Config File</td>
                        <td>
                            <asp:FileUpload runat="server" ID="configFile" Width="229px" />  <asp:HyperLink runat="server" ID="confResult" Target="_blank" />
                        </td>
                    </tr>
                    <tr>
                        <td>Logs Path</td>
                        <td>
                            <asp:TextBox ID="txtLogs" runat="server" ValidationGroup="Datafeed" Text='<%# Bind("Logs") %>'></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td>Install Instruction</td>
                        <td>
                            <asp:FileUpload runat="server" ID="setupFile" Width="229px" />  <asp:HyperLink runat="server" ID="setupResult" Target="_blank" />
                        </td>
                    </tr>
                    <tr>
                        <td>Execute Instruction</td>
                        <td>
                            <asp:FileUpload runat="server" ID="execFile" Width="229px" />  <asp:HyperLink runat="server" ID="execResult" Target="_blank" />
                        </td>
                    </tr>
                    <tr>
                        <td>Description</td>
                        <td>
                            <asp:TextBox ID="txtDescription" runat="server" ValidationGroup="Datafeed" TextMode="MultiLine" Height="58px" Width="303px" Text='<%# Bind("Description") %>'></asp:TextBox>
                        </td>
                    </tr>
                </table>
                <asp:Button runat="server" ID="btnUpdate" Text='<%#(Container is GridEditFormInsertItem) ? "Insert":"Update" %>'
                    CommandName='<%# (Container is GridEditFormInsertItem) ? "PerformInsert":"Update" %>' /> 
                            <asp:Button runat="server" ID="btnCancel" Text="Cancel" CausesValidation="False" CommandName="Cancel" />
            </FormTemplate>
        </EditFormSettings>
    </MasterTableView>
    <ClientSettings>
        <ClientEvents OnRowDblClick="RowDblClick"></ClientEvents>
    </ClientSettings>
</telerik:RadGrid>

protected void RadGrid1_EditCommand(object sender, GridCommandEventArgs e)
        {
            if (e.CommandName != RadGrid.EditCommandName) return;
            GridDataItem gridDataItem = e.Item as GridDataItem;
             
            var ddlMachineId = gridDataItem.FindControl("ddlMachineId") as DropDownList;
            var ddlDataAgentID = gridDataItem.FindControl("ddlDataAgentID") as DropDownList;
            var agentsList = gridDataItem.FindControl("agentsList") as ListBox;
            var confResult = gridDataItem.FindControl("confResult") as HyperLink;
            var execResult = gridDataItem.FindControl("execResult") as HyperLink;
            var setupResult = gridDataItem.FindControl("setupResult") as HyperLink;
}

gridDataItem.FindControl return null for all my ids.
Please help.
Princy
Top achievements
Rank 2
 answered on 23 Jul 2014
1 answer
124 views
Hi,

I have a project where I dynamic change the theme i.e. css. We also support multilingual, hence we have used RTL css also.

Since my base css is:
html, body
{
direction: rtl;
}

I have used RadEditor and my RadEditor toggle full screen does not work fine with if I use the base css direction: rtl;
To fix the same issue I have used a dynamic EditorContentArea_RTL.css file, where we use :
html, body
{
direction: ltr !important;
}

The issue is, toggle full screen doesn't open in full screen in RTL and the toolbar window (popup) doesn't open in the center of the screen.
Please note, RadEditor ToolbarMode used if floating.

If I change the base css class from

html, body
{
direction: rtl;
}
to
html, body
{
direction: ltr;
}
the RadEditor and even the toggle full screen works fine. But I need base css for rest of my code to be rtl.


I have read and checked few help articles on telerik site, but unfortunately it does not work.
Also if I use the toolbar as floating and toggle full screen, it doesn't work on Telerik site also.
Some links I used :
http://www.telerik.com/help/aspnet-ajax/editor-right-to-left-support.html
http://demos.telerik.com/aspnet-ajax/editor/examples/righttoleft/defaultcs.aspx

Waiting for a prompt reply !!
Thanks
Ianko
Telerik team
 answered on 23 Jul 2014
3 answers
109 views
Hi,

I have a project where I dynamic change the theme i.e. css. We also support multilingual, hence we have used RTL css also.

Since my base css is:
html, body
{
direction: rtl;
}

I have used RadEditor and my RadEditor toggle full screen does not work fine with if I use the base css direction: rtl;
To fix the same issue I have used a dynamic EditorContentArea_RTL.css file, where we use :
html, body
{
direction: ltr !important;
}

The issue is, toggle full screen doesn't open in full screen in RTL and the toolbar window (popup) doesn't open in the center of the screen.
Please note, RadEditor ToolbarMode used if floating.

If I change the base css class from

html, body
{
direction: rtl;
}
to
html, body
{
direction: ltr;
}
the RadEditor and even the toggle full screen works fine. But I need base css for rest of my code to be rtl.

I have read and checked few help articles on telerik site, but unfortunately it does not work.
Also if I use the toolbar as floating and toggle full screen, it doesn't work on Telerik site also.
Some links I used :
http://www.telerik.com/help/aspnet-ajax/editor-right-to-left-support.html
http://demos.telerik.com/aspnet-ajax/editor/examples/righttoleft/defaultcs.aspx

Waiting for a prompt reply !!
Thanks

Ianko
Telerik team
 answered on 23 Jul 2014
6 answers
242 views

Is possible open two different Popup Edit Form (EditMode="PopUp") in one RadGrid?
For each row adding TWO button like:
<telerik:GridEditCommandColumn ItemStyle-Width="1%" UniqueName="EditCommandColumn1" ButtonType="ImageButton" EditImageUrl="../../file/edit.gif" CancelText="Cancel" EditText="Edit" />

open two (but also three or four) different WebUserControl (file .ascx) that on "OK" button return values in the standard
"Private Sub RadGrid1_UpdateCommand" function, easily like the normal edit popup-mode

??

Is possible? Any example?

Giorgos
Top achievements
Rank 1
 answered on 23 Jul 2014
8 answers
446 views
I have an ASPX page with multiple RadGrids. All of these RadGrids have footer columns that need to be exported with the table.  Rather then exporting each grid itself, I am changing the content type of the page.  The code to do this works fine, however, when the export happens, the Grid's Footer rows are placed under the header row instead of at the bottom.  I noticed this was an issue back in 2008, but it was said to be fixed in the 2008 Q1?  release.  I am on Q1 2011 ASP.NET AJAX controls.  How can i make it so that the footer pages show up at the bottom instead of after the header?

}

protected void btnExcelExport_Click(object sender, EventArgs e)
    {
        HttpContext.Current.Response.Buffer = true;
        HttpContext.Current.Response.Clear();
        HttpContext.Current.Response.ContentType = "application/vnd.ms-excel";
        HttpContext.Current.Response.ContentEncoding = System.Text.Encoding.Default;
        HttpContext.Current.Response.AddHeader("content-disposition", "attachment; filename=Overview"
                                                + System.DateTime.Now.ToString("MMMddyyyy") + ".xls");
        HttpContext.Current.Response.Charset = string.Empty;
  
        this.Page.EnableViewState = false;
  
        StringWriter _writer = new StringWriter();
        HtmlTextWriter _textwriter = new HtmlTextWriter(_writer);
  
        btnExcelExport.Visible = false;
  
        Label1.BackColor = Color.White; 
        Label1.ForeColor = Color.Black;
  
        Label2.BackColor = Color.White;
        Label2.ForeColor = Color.Black;
  
        Label3.BackColor = Color.White;
        Label3.ForeColor = Color.Black;
            
        Master.HeaderbackColor = Color.White;
        Master.HeaderForeColor = Color.Black;
  
        Master.LinkVisiblity = false;
        Master.NavigationVisibility = false;
  
        this.Page.RenderControl(_textwriter);
  
        HttpContext.Current.Response.Write(_writer.ToString());
        HttpContext.Current.Response.Flush();
        HttpContext.Current.Response.Close();
    }

Vasil
Telerik team
 answered on 23 Jul 2014
4 answers
118 views
Hi
I m looking for an example to see if I can draw a chart as tooltip on some text.
By that, I mean, on some text, on mouse hover, a tool tip will appear with chart in it.
Thanks,
Danail Vasilev
Telerik team
 answered on 23 Jul 2014
5 answers
215 views
Hello Team,

I am trying to insert the record using EditFormTemplate of RadGrid. I need to calculate the value based on the one textbox which is in editformtemplate and show the value in another textbox. I can get the controls if I edit the existing records by using grid.MasterTableView.get_insertItem().

How can I get the template controls while adding new records.

Please help..

Thanks,

Vinay
Vinay
Top achievements
Rank 1
 answered on 23 Jul 2014
1 answer
145 views
I have a problem with Kendo Scheduler and Metronic Template left sidebar
when I collapse the sidebar , the scheduler move correctly but there is a problem in timelines that it keeps on previous location.
Georgi Krustev
Telerik team
 answered on 23 Jul 2014
1 answer
83 views
We are wanting to import rtf text from a database, edit it with RadEditor and then save it back to the database as rtf.  We have read through some of the earlier threads (2012) in this forum and note the lack of strong support for these import/export functions, but are wondering if any improvement has been made in more recent versions?
Rumen
Telerik team
 answered on 23 Jul 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Chester
Top achievements
Rank 1
Iron
Simon
Top achievements
Rank 1
Iron
Douglas
Top achievements
Rank 2
Iron
Iron
SUNIL
Top achievements
Rank 3
Iron
Iron
Iron
Marco
Top achievements
Rank 3
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?