Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
164 views
hello i am new using teleriks controls well i am new in asp.net too, i have some problems, i am using a radgrid than could update some information, in the sql statements of update i have two conditions  COD_COMPRA that i call from textbox and COD_MATPRI, the first one is all good but when i try to use both COD_MATPRI and COD_COMPRA not update anything...this is my code i hope u can help me

<telerik:RadGrid ID="RadGrid1" runat="server" DataSourceID="SqlDataSource5"
            GridLines="None" AllowAutomaticUpdates="True"
            AutoGenerateEditColumn="True" AllowAutomaticInserts="True">
            <MasterTableView AutoGenerateColumns="False" DataKeyNames="COD_MATPRIMA"
                DataSourceID="SqlDataSource5" EditMode="InPlace">
                <Columns>
                    <telerik:GridBoundColumn DataField="COD_MATPRIMA" HeaderText="COD_MATPRIMA"
                        ReadOnly="True" SortExpression="COD_MATPRIMA" UniqueName="COD_MATPRIMA">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="NOMMATPRI"
                        HeaderText="NOMMATPRI" SortExpression="NOMMATPRI"
                        UniqueName="NOMMATPRI">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="CANTIDAD" HeaderText="CANTIDAD"
                        SortExpression="CANTIDAD" UniqueName="CANTIDAD" DataType="System.Single">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="NOMBREMEDIDA"
                        HeaderText="NOMBREMEDIDA" SortExpression="NOMBREMEDIDA"
                        UniqueName="NOMBREMEDIDA">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="PRECIO" HeaderText="PRECIO"
                        SortExpression="PRECIO" UniqueName="PRECIO" DataType="System.Decimal">
                    </telerik:GridBoundColumn>
                    <telerik:GridBoundColumn DataField="TOTAL" DataType="System.Single"
                        HeaderText="TOTAL" SortExpression="TOTAL" UniqueName="TOTAL"
                        ReadOnly="True">
                    </telerik:GridBoundColumn>
                </Columns>
              <EditFormSettings>
                  <EditColumn UniqueName="
EditCommandColumn1">
                  </EditColumn>
              </EditFormSettings>
            </MasterTableView>
        </telerik:RadGrid>
      
        <asp:SqlDataSource ID="SqlDataSource5" runat="server"
            ConnectionString="<%$ ConnectionStrings:SICI2.0ConnectionString2 %>"
           
           
            SelectCommand="SELECT TBL_MATERIAPRIMA.COD_MATPRIMA, TBL_MATERIAPRIMA.NOMMATPRI, TBL_COM_MP.CANTIDAD, TBL_MEDIDA.NOMBREMEDIDA, TBL_COM_MP.PRECIO, TBL_COM_MP.CANTIDAD * TBL_COM_MP.PRECIO AS TOTAL FROM TBL_COMPRA INNER JOIN TBL_COM_MP ON TBL_COMPRA.COD_COMPRA = TBL_COM_MP.COD_COMPRA INNER JOIN TBL_MATERIAPRIMA ON TBL_COM_MP.COD_MATPRIMA = TBL_MATERIAPRIMA.COD_MATPRIMA INNER JOIN TBL_MEDIDA ON TBL_MATERIAPRIMA.COD_MEDIDA = TBL_MEDIDA.COD_MEDIDA WHERE (TBL_COMPRA.COD_COMPRA = @id_compra)"
            UpdateCommand="UPDATE TBL_COM_MP SET CANTIDAD = @cantidad, PRECIO = @precio WHERE (COD_COMPRA=@id_compra and COD_MATPRIMA=@cod_matprima) "> 
           
            <SelectParameters>
                <asp:ControlParameter ControlID="txtnumorden" Name="id_compra"
                    PropertyName="Text" />
            </SelectParameters>
            <UpdateParameters>
                <asp:Parameter Name="cod_matprima"/>
                <asp:Parameter Name="cantidad"/>
                <asp:Parameter Name="precio" />
                <asp:ControlParameter ControlID="txtnumorden" Name="id_compra"
                    PropertyName="Text" />
               
            </UpdateParameters>
        </asp:SqlDataSource>
 the second question is what can i do if i want to refresh when i update the radgrid... other part of my webpage... i mean i have radgrid and from data of the radgrid i have to calculate the total, IVA, etc or maybe refresh the enterire page  thanks
Antonio Stoilkov
Telerik team
 answered on 23 Dec 2011
1 answer
58 views
Hi,

I have a scenario where I display huge data and edit them using pop-up..

Some of my fields need to be comboboxes...where data has to be binded to tht particulat value for that resource..

I have a table employee...which has status (active,inactive)...but I need to bind this data from a look up table..
   EmploymentStatus:    <telerik:RadComboBox ID="ddlStatus" runat="server"    AppendDataBoundItems="true"                                         AllowCustomText="true" > </telerik:RadComboBox>

I have tried the below code to bind the values:but it didn't wok..getting null value in to the list object..

 protected void RadGrid1_ItemCommand(object source, GridCommandEventArgs e)
    {
        if (e.CommandName == "Edit")
        {
            GridEditableItem item = e.Item as GridEditableItem;
          RadComboBox list = item.FindControl("ddlStatus") as RadComboBox;
            SqlDataReader ddDR = null;
            myCommand.CommandText = "SELECT  [Name],[value]  FROM [Table1] where Name='Status'";
            myConnection = new SqlConnection(myConnectionstr);
            myConnection.Open();
            myCommand.CommandType = CommandType.Text;
            myCommand.Connection = myConnection;
            ddDR = myCommand.ExecuteReader();
            list.DataSource = ddDR;
            list.DataTextField = "Name";
            list.DataValueField = "Value";
            list.DataBind();


            ddDR.Dispose();
            myCommand.Dispose();
            myConnection.Dispose();
        }

    }

Can you please let me know how do I bind the data and also get the correct values when i click edit and empty value when I click insert...Will be of gr8 help..

Please advise..
thanks


                 
Dimitar Terziev
Telerik team
 answered on 23 Dec 2011
1 answer
85 views
Hi,

I am using ServerSideCallBack and would like nodes to be expanded to say two levels.
Is there a way I can emulate the asp TreeView ExpandDepth property on load.

I have tried setting node.Expanded but this doesn't seem to trigger the populate on demand.

Many thanks

Richard
Bozhidar
Telerik team
 answered on 23 Dec 2011
1 answer
87 views

Dear Telerik Team,

We are facing a problem with export to CSV feature using RadGrid. Actually we have a grid having a column showing range for ‘# of FTEs’ and ‘# of Freelancers’. You can find the column data in the attached file Grid.jpg. When we try to export the grid to CSV, these two columns converts to date column as shown in the attached file Excel.jpg.

Please provide us some solution for that.

Thanks

Tarika Team

Shinu
Top achievements
Rank 2
 answered on 23 Dec 2011
1 answer
56 views
Hi
I am encountered js problem when I use below client API.
 Does anyone can help me? thanks.

Case 1
var cMenu = $find("RadContextMenu1");
cMenu will be undefined!!

Case 2
var cMenu2 = $find("<%=RadContextMenu1.ClientID %>");
this is working.

but I would like to use the Case 1, due to I can pass the control's id into another function as a paramter in order to do more complex task and this way should be more fexible.

My developing environment as below.
VS2008 version 9.0.30729.1 SP
.NET Framework 3.5 SP1
telerik version is '2010.1.309.35'

Thank you!

Princy
Top achievements
Rank 2
 answered on 23 Dec 2011
6 answers
117 views
Hi,

I have a RadGrid which has AllowMultiRowSelect property to true. I have a button and on click of button i need to fetch details of selected rows.
I have wriiten following code on button click

 

protected void OnButtonClick( object sender,EventArgs e )

 

{ ArrayList ar = new ArrayList();

 

 

  

foreach (GridDataItem item in RadGridFrom.SelectedItems)

 

    {        ar.Add( item["Column1"].Text);//access the value here    

     }
}
but SelectedItems collectioin always have O items , I am not able to figure out why this is happening.

I also tried following code for fetching details of selected rows :

 

 

protected void OnButtonClick( object sender,EventArgs e )

 

{

   ArrayList ar = new ArrayList();

 foreach (GridDataItem item in RadGridFrom.MasterTableView.Items)

 

    {

         if (item.Selected)

 

        ar.Add( item["Column1"].Text);//access the value here    
    }

 

}

 but still it is not working.
I am using Telerik.Web.UI_2011_2_915_Trial dll
Kindly help with the solution ASAP.

Thanks,
Bhupendra

Rahul
Top achievements
Rank 2
 answered on 23 Dec 2011
1 answer
79 views
Hi all,

I used Telerik Control to develop my project. I have a problem below:


<telerik:GridTemplateColumn HeaderText="[Groupes]" UniqueName="GroupeContent">
                                <ItemTemplate>
                                    <asp:LinkButton ID="lblNom" CommandName="Select" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Nom") %>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="txtNom" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Nom") %>'
                                        MaxLength="30"></asp:TextBox>
                                </EditItemTemplate>

                              
                            </telerik:GridTemplateColumn> 
<telerik:GridTemplateColumn  UniqueName="GroupeFooter">
                                <ItemTemplate>
                                    <asp:ImageButton ID="ImageButton1" runat="server" CausesValidation="false" CommandName="Edit" 
                                        ImageUrl="~/Styles/images/edit16.gif" />
                                </ItemTemplate>
                                <EditItemTemplate>                                    
                                   .............
                                </EditItemTemplate
>                                
                            </telerik:GridTemplateColumn>

When I click on the icon "edit"=> TextBox appears and 2 link "update" "Cancel" are shown.

I want to replace 2 link "update" and "cancel" by 2 icons.
Please view attached file

Please help me to do it

Thanks alot.

Rahul
Top achievements
Rank 2
 answered on 23 Dec 2011
2 answers
82 views
in telerik grid I had a template field and included an ASP button in it
I want 2 simple task to be performed from this button 
1)I want to select different values in the Grid by that button click and pass it in session variable Or if possible to select the PK of that tuple.I am using LINQ and binding the grid from code behind.
 2) I wan to conditionally enable and disable button present in template field of RAD Grid 


Thanks 
usman
Top achievements
Rank 1
 answered on 23 Dec 2011
1 answer
114 views
Hi,

We are using RadGrid with EntityDatasource. We have pagination enabled on the RadGrid.
We loooked at the sql profiler and saw that RadGrid makes two calls to the database (through EntityDatasource). One call is for getting the total count (for displaying pages and count) and the second is for fetches actual records in the page.

Later when we move to the second page, I can see in the sql profiler that again two calls are made - one for count and other for all the rows of the second page.

Can we configure the radgrid such that it does not fetch the count on second or subsequent operations (like moving to next page or sorting)? Since the grid already has the total count whcih it gets on the first load, cant the radgrid maintian this and use this in the subsequent operations?

Thanks and Regards,
Bhaskar Shanbhag

PS. I am asking this question since our sql query which we use in the Entity Datasource is already very slow and calling it two times for every operation makes it slower.
Veli
Telerik team
 answered on 23 Dec 2011
1 answer
79 views
Hi all,
I used RADTelerik and I have a problem: I don't know replace link by TExt by ICON.
My code Page:

<telerik:GridTemplateColumn HeaderText="[Groupes]" UniqueName="GroupeContent">
                                <ItemTemplate>
                                    <asp:LinkButton ID="lblNom" CommandName="Select" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Nom") %>' />
                                </ItemTemplate>
                                <EditItemTemplate>
                                    <asp:TextBox ID="txtNom" runat="server" Text='<%# DataBinder.Eval(Container, "DataItem.Nom") %>'
                                        MaxLength="30"></asp:TextBox>
                                </EditItemTemplate
>
                               
                            </telerik:GridTemplateColumn>
....
I want to replace the 2 link "update" and "cancel" by icons.
Pls view attached file.

Thanks alot

Rahul
Top achievements
Rank 2
 answered on 23 Dec 2011
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?