Telerik Forums
UI for ASP.NET AJAX Forum
22 answers
454 views
I don't get the value in radgrid itemcomman how i pass in the need data soucrce
please replay as soon as possible




<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="NewModels.aspx.cs" Inherits="TBS_HelpDesk.Views.Assets.NewModels"
    MasterPageFile="~/Views/Shared/MasterPage.Master" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<asp:Content ID="aboutContent" ContentPlaceHolderID="MainContent" runat="server">
    <telerik:RadAjaxManager ID="RadAjaxManager1" runat="server">
        <AjaxSettings>
            <telerik:AjaxSetting AjaxControlID="RadGrid1">
                <UpdatedControls>
                    <telerik:AjaxUpdatedControl ControlID="RadGrid1" UpdatePanelHeight="" />
                </UpdatedControls>
            </telerik:AjaxSetting>
        </AjaxSettings>
    </telerik:RadAjaxManager>
    <telerik:RadGrid runat="server" ID="RadGrid1" CellPadding="0" GridLines="None" AutoGenerateColumns="False"
        AllowPaging="True" OnNeedDataSource="RadGrid1_NeedDataSource" OnItemCommand="RadGrid1_ItemCommand">
        <MasterTableView>
            <Columns>
                <telerik:GridBoundColumn DataField="Manuf_ID" DataType="System.Int32" HeaderText="Manuf ID"
                    SortExpression="Manuf_ID" UniqueName="Manuf_ID" Visible="false">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Manuf_Name" HeaderText="Manuf Name" SortExpression="Manuf_Name"
                    UniqueName="Manuf_Name">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Manuf_Description" HeaderText="Manuf Description"
                    SortExpression="Manuf_Description" UniqueName="Manuf_Description">
                </telerik:GridBoundColumn>
            </Columns>
        </MasterTableView>
        <ClientSettings EnablePostBackOnRowClick="true">
            <Selecting AllowRowSelect="True" />
        </ClientSettings>
    </telerik:RadGrid>
    <telerik:RadGrid runat="server" ID="RadGrid2" CellPadding="0" GridLines="None" AutoGenerateColumns="False"
        AllowPaging="True" Skin="WebBlue" OnItemCommand="RadGrid1_ItemCommand" OnNeedDataSource="RadGrid2_NeedDataSource">
        <MasterTableView CommandItemDisplay="Top" EditFormSettings-PopUpSettings-Modal="true"
            EditMode="PopUp">
            <Columns>
                <telerik:GridEditCommandColumn ButtonType="ImageButton" />
                <telerik:GridNumericColumn DataField="Model_ID" HeaderText="Model Id" SortExpression="Model_ID"
                    UniqueName="Model_ID" Visible="false" ReadOnly="true">
                </telerik:GridNumericColumn>
                <telerik:GridBoundColumn DataField="Model_Name" HeaderText="Model Name" SortExpression="Model_Name"
                    UniqueName="Model_Name">
                </telerik:GridBoundColumn>
                <telerik:GridBoundColumn DataField="Model_Description" DataType="System.Boolean"
                    HeaderText="Model Description" SortExpression="Model_Description" UniqueName="Model_Description">
                </telerik:GridBoundColumn>
                <telerik:GridButtonColumn CommandName="Delete" ButtonType="ImageButton" UniqueName="DeleteColumn"
                    CommandArgument="Child" ConfirmDialogType="RadWindow" ConfirmText="Are You Sure Want To Delete This Record?"
                    ConfirmTitle="Delete Confirm" />
            </Columns>
        </MasterTableView>
    </telerik:RadGrid>
</asp:Content>






using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Data;
using System.IO;
using Telerik.Web.UI;
using System.Data.SqlClient;
using System.Configuration;


namespace TBS_HelpDesk.Views.Assets
{
    public partial class NewModels : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            //if (!IsPostBack)
            //{
            //    LoadManufacturers();
            //}            
        }

        protected void RadGrid1_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            DataTable dtTable = new DataTable();
            string conn = ConfigurationManager.ConnectionStrings["TBSHelpDeskLiveDB_ConnectionString"].ToString();
            SqlDataAdapter sqladp = new SqlDataAdapter();
            SqlConnection sqlconn = new SqlConnection(conn);
            sqlconn.Open();

            try
            {
                string selectQuery = "SELECT Manuf_ID,Manuf_Name,Manuf_Description FROM [AssetManufacturers] order by Manuf_ID asc";
                sqladp.SelectCommand = new SqlCommand(selectQuery, sqlconn);
                sqladp.Fill(dtTable);
                RadGrid1.DataSource = dtTable;

            }
            finally
            {
                sqlconn.Close();
            }
        }

        protected void RadGrid2_NeedDataSource(object sender, GridNeedDataSourceEventArgs e)
        {
            SqlConnection connection = new SqlConnection(
         ConfigurationManager.ConnectionStrings["TBSHelpDeskLiveDB_ConnectionString"].ConnectionString);

            SqlDataAdapter adapter = new SqlDataAdapter("SELECT Model_ID,Model_Name,Model_Description FROM " +
                " AssetModels WHERE Model_Manuf_ID =  ", connection);
            DataTable dt = new DataTable();
            adapter.Fill(dt);
            RadGrid2.DataSource = dt;
        }


        protected void RadGrid1_ItemCommand(object sender, GridCommandEventArgs e)
        {
            if (e.CommandName == "RowClick")
            {
                GridDataItem item = (GridDataItem)e.Item;
                string Manuf_ID = item["Manuf_ID"].Text;
                LoadModels(Manuf_ID);
            }
        }
        protected void LoadModels(string Manuf_ID)
        {
            SqlConnection connection = new SqlConnection(
      ConfigurationManager.ConnectionStrings["TBSHelpDeskLiveDB_ConnectionString"].ConnectionString);

            SqlDataAdapter adapter = new SqlDataAdapter("SELECT Model_ID,Model_Name,Model_Description FROM " +
                " AssetModels WHERE Model_Manuf_ID=@Manuf_ID ORDER By Model_Manuf_ID,Model_ID", connection);
            adapter.SelectCommand.Parameters.AddWithValue("@Manuf_ID", Manuf_ID);
            DataTable dt = new DataTable();
            adapter.Fill(dt);
            RadGrid2.DataSource = dt;
            RadGrid2.DataBind();
        }
    }
}
mohamed
Top achievements
Rank 1
 answered on 23 Apr 2011
1 answer
95 views
I have a radgrid that i am trying to customize using properties like backcolor.
I changed the backcolor of my header to be red (#E31B23) in both the mastertableview and the main grid properties; on the design view in visual studio the color is changed, but once i try to see the change in the browser the color is not there.

Same thing when i change the skin of the grid: in visual studio i see the change of skin, but once i go live in a browser, nothing is changed. Please help. 
Pavlina
Telerik team
 answered on 22 Apr 2011
1 answer
90 views
I have a simple web page that gives the option of selecting one of two radio buttons.  Depending on which one they select, I want of the bottom portion of the form to become visible after they select the 2nd radio button, but otherwise I want it to remain hidden.  Seems like I used to do this with a plain Ajax panel, but I don't see one listed now.
dean.carrefour
Top achievements
Rank 1
 answered on 22 Apr 2011
13 answers
390 views
Hello,

In IE8 and FF3 i run into a strange problem.

I know all about the 100% solution, and use this standard on every page.
e.q. 
    <style type="text/css">  
        html, body, form  
        {  
            width: 100%;  
            height: 100%;  
            overflow: hidden;  
        }  
    </style> 

 

If i use a simple radgrid with Scrolling-UseStaticHeaders="true" on a page, without any container or other control, the grid is 100% heigth, and this is working perfect.
But as soon as i put a RadAjaxmanager on the page, the RadGrid is going from 300px to 10 px in a split second when the page load, and stays 10px.
e.q. 

 

    <telerik:RadAjaxManager ID="RAM" runat="server" > 
        <AjaxSettings> 
            <telerik:AjaxSetting AjaxControlID="myRadrid (or any other control)">  
                <UpdatedControls> 
                    <telerik:AjaxUpdatedControl ControlID="myRadGrid" /> 
                </UpdatedControls> 
            </telerik:AjaxSetting> 
        </AjaxSettings> 
    </telerik:RadAjaxManager> 

 

For testing i put the Radgrid inside the form container, so the heigth for the container is set.
I can write a workaround in js to follow the window height, but that is not real smooth solution.
The Grid is then loading from 300px, to 10px, and then the right height...

I'am sure the RadAjaxmanager is the reason for this, but is there a solution?
p.s. i use the latest 2009.1 402 build.

 

Michael
Top achievements
Rank 1
 answered on 22 Apr 2011
6 answers
344 views
Hi,
I am putting together a line chart to display data from a MSSQL database but cannot stop the numerical score labels from displaying. I have gone through all of the examples but need a little assistance. Please take a look at what I have and add what I need to stop the scores from rendering on the lines. I have attached images of existing render and table.
I appreciate your time.

<asp:SqlDataSource ID="SqlDataSource1" ConnectionString="<%$ ConnectionStrings:IPdataConnectionString %>"
    ProviderName="System.Data.SqlClient" SelectCommand="SELECT top 7 Date = CONVERT(char(10), Date, 101), score, IPaddress, Partner FROM IPhistory WHERE Partner = 'NEAstates' ORDER BY Date ASC;" runat="server">
</asp:SqlDataSource>
            <telerik:radchart id="RadChart4" runat="server" width="800px" datasourceid="SqlDataSource1"
                defaulttype="Line" autolayout="true" charttitle-visible="false">
                <Appearance TextQuality="AntiAlias">
                </Appearance>
                <PlotArea>
                <Appearance Dimensions-Margins="18%, 24%, 12%, 16%"></Appearance>
                    <YAxis Step="10" AxisMode="Extended">
                        <Appearance MajorGridLines-Visible="true" MinorGridLines-Visible="false">
                        </Appearance>
                    </YAxis>
                    <XAxis DataLabelsColumn="Date" LayoutMode="Between">
                        <Appearance ValueFormat="ShortDate" MajorGridLines-Visible="true">
                            <LabelAppearance RotationAngle="10" Position-AlignedPosition="Top">
                            </LabelAppearance>
                        </Appearance>
                    </XAxis>
                </PlotArea>
            </telerik:radchart>

protected void Page_Load(object sender, EventArgs e)
{
    if (!Page.IsPostBack)
    {
        // Manually setting the series groups and Y values columns
        RadChart4.DataGroupColumn = "IPaddress";
        RadChart4.DataManager.ValuesYColumns = new string[1] { "score" };
        RadChart4.Skin = "LightBlue";
        ChartSeries chartSeries = new ChartSeries();
        chartSeries.Type = ChartSeriesType.Line;
        chartSeries.Appearance.LabelAppearance.Visible = false;
    }
}


JT
Top achievements
Rank 1
 answered on 22 Apr 2011
1 answer
94 views
Hi All
I can get the value of a control inside a radgrid cell with javascript with:

        function RowSelected(sender, eventArgs) {
            var grid = sender;
            var MasterTable = grid.get_masterTableView();
            var row = MasterTable.get_dataItems()[eventArgs.get_itemIndexHierarchical()];
            var txtbox = row.findElement("Numeric1");
            var txtboxValue = txtbox.value;
            alert(txtboxValue);
        }
which works great, however when i want to set the value, i cant set it.

Any idea?

İf i use a standart textbox i can set the value by
 row.findElement("TextBox1").value = '15';

 however i am using RadNumericTextbox and it cant set the value as i do with standart textbox


Vasil
Telerik team
 answered on 22 Apr 2011
1 answer
180 views
Hello,

I am having this issue with MakeUrlsAbsolute on the rad Editor in IE8.  Steps to reproduce:

- create a page with a RadEditor and ContentFilters containing MakeUrlsAbsolute
- visit your website under a secure domain: ie: https://telerik.com/MyPage.aspx using IE8http://www.google.ca/images/logos/ps_logo2.png
- click on HTML view in the editor
- paste testing <img src="http://www.google.ca/images/logos/ps_logo2.png"> testing
- switch back to design view
- when prompted with the IE8 "Do you want to view only the webpage content that was delivered securely?"   - select YES
- it does not go back to design view
- clicking on Design does nothing, clicking on HTML again will prompt the error: "Message from webpage    Error while executing filter MakeUrlsAbsolute - [object Error]

thanks
Rumen
Telerik team
 answered on 22 Apr 2011
4 answers
317 views

I am populating RadPanelBar from the database. The following is my code.  I have a db column that specifies enable true or false. I would like to set the RadPanelItem enable property using this. How can I do this?

 


Dim
dt As New DataTable

dt =GetPanelItems(Id) – proc to call oracle

Dim links As New DataSet()

 

        links.Tables.Add(dt)

        RadPanelBar1.DataTextField = "panel_name"

        RadPanelBar1.DataNavigateUrlField = ""

        RadPanelBar1.DataFieldID = "panel_id"

        RadPanelBar1.DataFieldParentID = "Parent_panel_Id"

        RadPanelBar1.DataValueField = "panel_value"

        RadPanelBar1.DataSource = links

        RadPanelBar1.DataBind()
Thanks

Nikolay Tsenkov
Telerik team
 answered on 22 Apr 2011
1 answer
135 views
It seems to be impossible to add text after a table, when the table is at the bottom of the document. If I use the arrow or try to click below the table it just selects the table. I want the text to be outside the table underneath it. How can I do that?

thank you
Rumen
Telerik team
 answered on 22 Apr 2011
2 answers
225 views
Hello,

Problem in RadScheduler(Width) auto adjustment in any screen(Big And Small) and in IE/FireBox/Grome/Shafari.

We used 

script type="text/javascript">
    function resizeScheduler()   
                  {
                      var scheduler = $find('<%=RadScheduler1.ClientID %>');
                      scheduler.get_element().style.width = "100%";
                      scheduler.repaint();
                  }
</script> 
And also set width=100% in RadScheduler control

In C# code
RadScheduler1.Width = Unit.Percentage(100);
but it is not work.

please help me as soon as possible.


Thanks

Best Regards
Mutum Jiten Singh
Akhil Systems
Jiten
Top achievements
Rank 1
 answered on 22 Apr 2011
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?