Telerik Forums
UI for ASP.NET AJAX Forum
3 answers
76 views
Hi

On uploading files the file name is rendered below the control. There can I add custom text along with the file name?

Thanks
Sameer
Shinu
Top achievements
Rank 2
 answered on 18 Jul 2013
0 answers
110 views
hello sir

 I have Piechart with two series
my x values for both series is same but y values are diffrent

but when i assign them ,both the series are updated with values of series 2


For both series I am passing different values , but when i assign Datatable to RadChart2 it takes only values of series 2 and assign for both series

please help me
waiting for reply

 
<telerik:RadChart ID="RadChart2" runat="server" Height="400px" Visible ="false" Skin ="DeepBlue"
              Width="900px" OnItemDataBound="RadChart2_ItemDataBound" AutoLayout="true" AutoTextWrap="true" IntelligentLabelsEnabled ="true" >
      <Series>
            <telerik:ChartSeries Name="Cost_Of_Job" Type="Pie" DataYColumn="Count"  >
               <Appearance LegendDisplayMode="ItemLabels">
               </Appearance>
            </telerik:ChartSeries>
             
            <telerik:ChartSeries Name="Total_Invoice" Type="Pie" DataYColumn="Count" Visible ="false">
               <Appearance LegendDisplayMode="ItemLabels">
               </Appearance>
            </telerik:ChartSeries>
        </Series>
         
     </telerik:RadChart>

Protected Sub UpdateChart2(ByVal one As Double, ByVal two As Double, ByVal three As Double, ByVal four As Double, ByVal five As Double, ByVal six As Double, ByVal seven As Double, ByVal eight As Double, ByVal nine As Double)
 
       Try
           tblCostInvoiceheader.Visible = True
           tblCostInvoiceDetails.Visible = True
           RadChart2.ChartTitle.TextBlock.Text = cbChartBy.Text
           Dim salesSeries As ChartSeries = RadChart2.GetSeries("Cost_Of_Job")
           Dim InvoiceSeries As ChartSeries = RadChart2.GetSeries("Total_Invoice")
           InvoiceSeries.Visible = False
           InvoiceRow.Visible = False
 
 
 
           Dim Total As Double = 0
           Dim one1 As Double = one
           Dim two1 As Double = two
           Dim three1 As Double = three
           Dim four1 As Double = four
           Dim five1 As Double = five
           Dim six1 As Double = six
           Dim seven1 As Double = seven
           Dim eight1 As Double = eight
           Dim nine1 As Double = nine
 
 
           Total = (one + two + three + four + five + six + seven + eight + nine)
 
           one1 = ((one / Total) * 100)
           two1 = ((two / Total) * 100)
           three1 = ((three / Total) * 100)
           four1 = ((four / Total) * 100)
           five1 = ((five / Total) * 100)
           six1 = ((six / Total) * 100)
           seven1 = ((seven / Total) * 100)
           eight1 = ((eight / Total) * 100)
           nine1 = ((nine / Total) * 100)
 
          
           Dim dt As New DataTable
           dt.Columns.Add("Invoice")
           dt.Columns.Add("Count")
           dt.Rows.Add(cbInvoiceStatus.Items(0).Text, one1)
           dt.Rows.Add(cbInvoiceStatus.Items(1).Text, two1)
           dt.Rows.Add(cbInvoiceStatus.Items(2).Text, three1)
           dt.Rows.Add(cbInvoiceStatus.Items(3).Text, four1)
           dt.Rows.Add(cbInvoiceStatus.Items(4).Text, five1)
           dt.Rows.Add(cbInvoiceStatus.Items(5).Text, six1)
           dt.Rows.Add(cbInvoiceStatus.Items(6).Text, seven1)
           dt.Rows.Add(cbInvoiceStatus.Items(7).Text, eight1)
           dt.Rows.Add(cbInvoiceStatus.Items(8).Text, nine1)
 
           RadChart2.Series(0).DataYColumn = "Count"
           RadChart2.DataSource = dt
           RadChart2.DataBind()
 
 
           txtBillable.Text = one
           txtBillableST.Text = two
           txtStartUp.Text = three
           txtStartupST.Text = four
           txtTraningService.Text = five
           txtTrainingSTService.Text = six
           txtWarranty.Text = seven
           txtWarrantyST.Text = eight
           txtUnspecifiedCost.Text = nine
 
 
           'if Invoice vs Cost
 
           If cbChartBy.Text = "Invoice vs Cost" Then
 
               Call CostVSInvoice()
               InvoiceRow.Visible = True
               InvoiceSeries.Visible = True
 
               Dim Total1 As Double = 0
               Dim one2 As Double = 0
               Dim two2 As Double = 0
               Dim three2 As Double = 0
               Dim four2 As Double = 0
               Dim five2 As Double = 0
               Dim six2 As Double = 0
               Dim seven2 As Double = 0
               Dim eight2 As Double = 0
               Dim nine2 As Double = 0
 
 
               Total1 = (CountInvBillable + CountInvBillableST + CountInvStartUp + CountInvStartUpST + CountInvTrainingService + CountInvTrainingSTService + CountInvWarranty + CountInvWarrantyST + CountInvCost)
 
               one2 = ((CountInvBillable / Total1) * 100)
               two2 = ((CountInvBillableST / Total1) * 100)
               three2 = ((CountInvStartUp / Total1) * 100)
               four2 = ((CountInvStartUpST / Total1) * 100)
               five2 = ((CountInvTrainingService / Total1) * 100)
               six2 = ((CountInvTrainingSTService / Total1) * 100)
               seven2 = ((CountInvWarranty / Total1) * 100)
               eight2 = ((CountInvWarrantyST / Total1) * 100)
               nine2 = ((CountInvCost / Total1) * 100)
 
             

               Dim dt1 As New DataTable
               dt1.Columns.Add("Invoice")
               dt1.Columns.Add("Count")
               dt1.Rows.Add(cbInvoiceStatus.Items(0).Text, one2)
               dt1.Rows.Add(cbInvoiceStatus.Items(1).Text, two2)
               dt1.Rows.Add(cbInvoiceStatus.Items(2).Text, three2)
               dt1.Rows.Add(cbInvoiceStatus.Items(3).Text, four2)
               dt1.Rows.Add(cbInvoiceStatus.Items(4).Text, five2)
               dt1.Rows.Add(cbInvoiceStatus.Items(5).Text, six2)
               dt1.Rows.Add(cbInvoiceStatus.Items(6).Text, seven2)
               dt1.Rows.Add(cbInvoiceStatus.Items(7).Text, eight2)
               dt1.Rows.Add(cbInvoiceStatus.Items(8).Text, nine2)
 
               RadChart2.Series(1).DataXColumn = "Count"
               RadChart2.DataSource = dt1
               RadChart2.DataBind()
 
 
               txtInvBillable.Text = CountInvBillable
               txtInvBillableST.Text = CountInvBillableST
               txtInvStartUp.Text = CountInvStartUp
               txtInvStartUpST.Text = CountInvStartUpST
               txtInvTrainingService.Text = CountInvTrainingService
               txtInvTrainingSTService.Text = CountInvTrainingSTService
               txtInvWarranty.Text = CountInvWarranty
               txtInvWarrantyST.Text = CountInvWarrantyST
               txtUnspecifiedInvoice.Text = CountInvCost
 
           End If
 
       Catch ex As Exception
           RadWindowManagerchartbyInvoice.RadAlert(Replace(ex.Message.ToString, "'", "\'"), 380, 100, "Error-UpdateChart2", "")
       End Try
 
   End Sub



             
Kishor
Top achievements
Rank 2
 asked on 18 Jul 2013
4 answers
175 views
I want to use the RadGrid for user to do data entry
inside the grid, there was a few of RadComboBox, RadNumericTextBox for edit.

i want to use the Add Row Button outside the grid, i use the following methods and it did not work
1) i have try add new row on the datatable and rebind grid
2) RadGrid1.MasterTableView.IsItemInserted = True

i want to know if the grid can do a multi row edit, where user can select any item to edit without the needs to click the Edit and Update button on the grid, and click the Submit button out of the grid the save the data.

i face a problem on data binding the grid, and it is saying System.ArgumentException: Grid Data Source Error :Column 'invBCItm_guid' does not belong to table .
i having the column in the datatable and the ASPX

 i am newbie to telerik, i need some information & guides on this.
S L
Top achievements
Rank 1
 answered on 18 Jul 2013
1 answer
1.1K+ views
Hi,
  
I have datakeyname value. I need to get a row using this key value out of Radgrid events. All the code
is in Radgrid events. Out of Radgrid events means, they suggest to loop thru
Rows and get a row like this:
  
Foreach (GridDataItem row in Radgrid1.Items)
{
    If (row.GetDataKeyValue(“ID”).ToString() == “100”)
               Row.Remove;
}
  
One more thing is that when that particular row is found, I need to delete it from grid.
But GridDatItem (row) doesn’t have delete or remove method. It has only dispose. I don’t think dispose
does the job of delete. I don’t want grid to be rebound after deleting row.
  
Please suggest how to do it. We are not using needsource event to bind grid. Our architecture will not
suit to use it. So, we bind the grid where ever necessary. I need to have this code for our page to work.
  
Thanks,
Prathiba.
Jayesh Goyani
Top achievements
Rank 2
 answered on 18 Jul 2013
1 answer
180 views
Hi guys

I am trying to convert the selected time in radtimepicker to am/pm format using the following code.

string start = RadTimePickerstartschedule.SelectedTime.ToString("hh:mm:tt");

but I am getting an error that there is no ToString() that takes 1 argument.
Actually the radtimepicker displays date in am/pm format but when I checked in C# code, its automatically converted to 24 clock format. How can I convert the time to am/pm format?

Please help soon
Antony
A2H
Top achievements
Rank 1
 answered on 18 Jul 2013
1 answer
143 views
Hi

Using CSS styles, how can I set a custom color to selected item background?

Thanks,
Damian.
Shinu
Top achievements
Rank 2
 answered on 18 Jul 2013
1 answer
113 views
Hi

I want to insert a Check All and UnCheck All Item in radlistbox. On Checking all items the item should change to UnCheck All. I tried some code found in net, but that was not changing the item.

Thanks
Damian.
Shinu
Top achievements
Rank 2
 answered on 18 Jul 2013
1 answer
109 views
Dear All,

I have been facing some issues deploying a RadGrid that has a couple of autocomplete RadComboboxes embedded in the edit mode without any resolution for several days now. An ajax related error (Sys.WebForms :Code 0 ) prevents the grid from activating the "INSERT" and "EDIT" mode. I have 2 tables that is referenced by FK_ relations like so:

dbo.Orders

| OrderId | OriginId | DestinationId |

dbo.Locations

| CityId | CityName |


OriginId and DestinationId is actually FK_ referring to CityId

Here is the source code snippets that I use:

ASPX
<telerik:GridTemplateColumn HeaderText="Origin">
                            <ItemTemplate>
                                 <%#DataBinder.Eval(Container.DataItem, "Origin")%>
                            </ItemTemplate>
                            <EditItemTemplate>
                                 <telerik:RadComboBox runat="server" ID="RadComboBox5" DataTextField="Origin" OnItemsRequested="RadComboBox5_ItemsRequested"
                                      EnableLoadOnDemand="true"
                                      DataValueField="OriginId" OnSelectedIndexChanged="RadComboBox5_SelectedIndexChanged" DataSourceID="OriginDataSource"
                                      SelectedValue='<%#Bind("OriginId") %>'>
                                 </telerik:RadComboBox>
                            </EditItemTemplate>
                       </telerik:GridTemplateColumn>
 
                        <telerik:GridTemplateColumn HeaderText="Destination">
                            <ItemTemplate>
                                 <%#DataBinder.Eval(Container.DataItem, "Destination")%>
                            </ItemTemplate>
                            <EditItemTemplate>
                                 <telerik:RadComboBox runat="server" ID="RadComboBox6" DataTextField="Destination" EnableAutomaticLoadOnDemand="true"
                                     OnItemsRequested="RadComboBox6_ItemsRequested"
                                      DataValueField="DestinationId" OnSelectedIndexChanged="RadComboBox6_SelectedIndexChanged" DataSourceID="ConsigneesDataSource"
                                      SelectedValue='<%#Bind("DestinationId") %>'>
                                 </telerik:RadComboBox>
                            </EditItemTemplate>
                       </telerik:GridTemplateColumn>



C#
protected void RadComboBox5_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            string sql = "SELECT [CityId], [CityName] FROM [Loications] WHERE CityName LIKE @CityName + '%'";
            SqlDataAdapter adapter = new SqlDataAdapter(sql,
                ConfigurationManager.ConnectionStrings["test"].ConnectionString);
            adapter.SelectCommand.Parameters.AddWithValue("@CityName", e.Text);
  
            DataTable dt = new DataTable();
            adapter.Fill(dt);
  
            RadComboBox comboBox = (RadComboBox)sender;
  
            comboBox.Items.Clear();
  
            foreach (DataRow row in dt.Rows)
            {
                RadComboBoxItem item = new RadComboBoxItem();
                item.Text = row["CityName"].ToString();
                item.Value = row["CityId"].ToString();
  
                comboBox.Items.Add(item);
  
                item.DataBind();
            }
        }
  
        protected void RadComboBox5_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            Session["CityId"] = e.Value;
        }
  
        protected void RadComboBox6_ItemsRequested(object sender, RadComboBoxItemsRequestedEventArgs e)
        {
            string sql = "SELECT [CityId], [CityName] FROM [Locations] WHERE CityName LIKE @CityName + '%'";
            SqlDataAdapter adapter = new SqlDataAdapter(sql,
                ConfigurationManager.ConnectionStrings["test"].ConnectionString);
            adapter.SelectCommand.Parameters.AddWithValue("@CityName", e.Text);
  
            DataTable dt = new DataTable();
            adapter.Fill(dt);
  
            RadComboBox comboBox = (RadComboBox)sender;
  
            comboBox.Items.Clear();
  
            foreach (DataRow row in dt.Rows)
            {
                RadComboBoxItem item = new RadComboBoxItem();
                item.Text = row["CityName"].ToString();
                item.Value = row["CityId"].ToString();
  
                comboBox.Items.Add(item);
  
                item.DataBind();
            }
        }
  
        protected void RadComboBox6_SelectedIndexChanged(object sender, RadComboBoxSelectedIndexChangedEventArgs e)
        {
            Session["CityId"] = e.Value;
        }

DataSources String Used:

<asp:SqlDataSource ID="MasterViewDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:test %>"
         SelectCommand="SELECT     Orders.OrderId, a1.CityName AS Origin, a2.CityName AS Destination
FROM         Orders INNER JOIN
                      Locations AS a1 ON a1.CityId = TransactsData.ShiprId INNER JOIN
                      Locations AS a2 ON a2.CityId = TransactsData.ConsId "
                  
                 InsertCommand="INSERT INTO [Orders] ([OriginId], [DestinationId], [TimeCreated])
             
                                    VALUES (@OriginId, @DestinationId, GETDATE())"
                  
                 UpdateCommand="UPDATE   [Orders] SET [OriginId] = @OriginId,
[DestinationId] = @DestinationId, [TimeUpdated] = @GETTIME()">

Radcombobox datasource
<asp:SqlDataSource ID="OriginDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:test %>"
          SelectCommand="SELECT [CityId], [CityName] FROM [Locations]"></asp:SqlDataSource>
 
    <asp:SqlDataSource ID="DestinationDataSource" runat="server" ConnectionString="<%$ ConnectionStrings:test %>"
          SelectCommand="SELECT [CityId], [CityName] FROM [Locations]"></asp:SqlDataSource>


The above code however does work if I erase either Origin or Destination combobox template column and bind the combobox template directly to the locations table. any advise to improve on this matter is much appreciated.

Bernard
Top achievements
Rank 2
 answered on 18 Jul 2013
0 answers
238 views
I have a radgrid.  Inside the radgrid I have an edit form template.  Inside the edit form template I have a  hiddenfield and a radtabstrip.  The radtabstrip has the OnTabClick and OnClientTabSelecting events wired up.  When one of the tabs is clicked the hiddenfield is set to true in the javascript function.  When the server code executes on postback the hiddenfield is always blank.  Why is this?  Please help.  By the way this page is not wired up for ajax.

The markup...

<EditFormSettings EditFormType="Template" >
    <FormTableItemStyle width="100%"></FormTableItemStyle>
    <FormTableStyle GridLines="None" CellSpacing="0" CellPadding="2"></FormTableStyle>
    <FormStyle Width="100%" backColor="white"></FormStyle>
    <FormTemplate>
        <div runat="server" id="divManageObligation" class="ContentSettings">
            <asp:HiddenField runat="server" ID="hdnManageObligations"/>
        <telerik:RadTabStrip runat="server" ID="rtsManageObligations" MultiPageID="rmpMultiPage" OnClientTabSelecting="OnTabSelecting"
                                OnTabClick="rtsManageObligations_TabClick"  Width="100%">
            <Tabs>
                <telerik:RadTab runat="server" Text="<%$ Resources:ui_labels, rtProgramDetails %>" Value="AlwaysLoaded"></telerik:RadTab>
                <telerik:RadTab runat="server" Text="<%$ Resources:ui_labels, rtObligations %>" ></telerik:RadTab>
                <telerik:RadTab runat="server" Text="<%$ Resources:ui_labels, rtAssistantshipHistory %>"></telerik:RadTab>
                <telerik:RadTab runat="server" Text="<%$ Resources:ui_labels, rtRegistrationHistory %>"></telerik:RadTab>
            </Tabs>

and the javascript....
function OnTabSelecting(sender, args) {
 
    var editedItemsArray = $find("<%=rgCandidateList.ClientID %>").get_masterTableView().get_editItems(); ;
    var editFormItem = editedItemsArray[0].get_editFormItem();
    var hdnManageObligations = $telerik.findElement(editFormItem, 'hdnManageObligations');
    hdnManageObligations.value = true;
    if (args.get_tab().get_value()) {
        args.get_tab().set_postBack(false);
    }
}

... when I inspect the contents of hdnManageObligations in the browser debugger it is set to "true"...

...and the code behind...

    Protected Sub rgCandidateList_ItemCreated(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridItemEventArgs) Handles rgCandidateList.ItemCreated
        Dim editItem As GridEditFormItem
 
...some code removed.....
 
        ElseIf TypeOf e.Item Is GridEditFormItem And e.Item.IsInEditMode Then
            editItem = CType(e.Item, GridEditFormItem)
 
            Dim a As HiddenField
            Dim b As String
            a = CType(editItem.FindControl("hdnManageObligations"), HiddenField)
            b = a.value
            If  CType(editItem.FindControl("hdnManageObligations"), HiddenField).Value = "true" Then
                editItem.FindControl("divManageObligation").Visible = True
                editItem.FindControl("divDecision").Visible = False
            Else
..... rest of code removed.

the variable "a" in the code snippet above is a valid object of type "Hidden", but a.value is always blank and the sub rtsManageObligations_TabClick is never hit.  I have a break point in the routine.

Any help in solving why the hidden field is blank  would be appreciated.

Thanks,
Dan
Dan
Top achievements
Rank 1
 asked on 17 Jul 2013
0 answers
105 views
I tried to copy the code from the demo page http://demos.telerik.com/aspnet-ajax/editor/examples/saveindatabase/defaultcs.aspx modified it and compile it. When  I tried to click on edit button each different items, the previous item will disappea. and I tried to edit the context I got the error on this line item.FireCommandEvent(RadGrid.UpdateCommandName, string.Empty);. Please help
Thank you
Q
Top achievements
Rank 1
 asked on 17 Jul 2013
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?