Telerik Forums
UI for ASP.NET AJAX Forum
5 answers
1.3K+ views
I am having issues with Paging within a Radgrid.  I have specified a PageStyle Mode="Advanced".   If I change the mode to NextPrevNumericAndAdvanced or any other type with the Go To First, Previous, Next and Go To Last page buttons these will work fine but in Advanced mode the Textbox to change the page and pagesize do not work.  It causes a postback on the page but does not update the grid data or the paging/pagesize textbox(es).  I am using NeedDataSource for my grid binding and when I break the code during this procedure the CurrentPageIndex is always set to 0.  Any help would be great.

Angel Petrov
Telerik team
 answered on 10 Jun 2014
1 answer
231 views
Hi,

I am new to telerik, I want to design page having a grid which should allow user to insert new row & allow batch update to modify exsisting items, grid should also have combo box columns. I want to poplate grid and all combo box kept in Edit item template on code behind.
please let me know how to do this.
Princy
Top achievements
Rank 2
 answered on 10 Jun 2014
1 answer
192 views
I have a RadGrid displaying 12 months of data that I would like to update in batch mode. I don't want to have to update each row individually. When the grid is displayed, the column headings disappear, but the grid populates from an external data source. The data is there, but no column headings. If I change the EditMode from Batch to any other option, the column headings appear. How do I get the column headings to show up whil in Batch mode?


<telerik:RadGrid ID="RadGrid1" runat="server" CellSpacing="0" DataSourceID="GetMiles" GridLines="None" AllowMultiRowEdit="True" AllowMultiRowSelection="True" AutoGenerateColumns="False" ShowHeader="False">
<ClientSettings>
<Selecting AllowRowSelect="True" />
</ClientSettings>
<MasterTableView DataSourceID="GetMiles" EditMode="batch" CommandItemDisplay="Bottom" ShowHeader="true" CommandItemSettings-ShowAddNewRecordButton="false" AllowNaturalSort="False">
<RowIndicatorColumn Visible="False">
</RowIndicatorColumn>
<CommandItemSettings ShowAddNewRecordButton="False"></CommandItemSettings>
<Columns>
<telerik:GridBoundColumn DataField="division" FilterControlAltText="Filter division column" HeaderText="Div" SortExpression="division" UniqueName="division">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="January" DataType="System.Double" FilterControlAltText="Filter January column" HeaderText="Jan" SortExpression="January" UniqueName="January">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="February" DataType="System.Double" FilterControlAltText="Filter February column" HeaderText="Feb" SortExpression="February" UniqueName="February">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="March" DataType="System.Double" FilterControlAltText="Filter March column" HeaderText="March" SortExpression="March" UniqueName="March">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="April" DataType="System.Double" FilterControlAltText="Filter April column" HeaderText="April" SortExpression="April" UniqueName="April">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="May" DataType="System.Double" FilterControlAltText="Filter May column" HeaderText="May" SortExpression="May" UniqueName="May">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="June" DataType="System.Double" FilterControlAltText="Filter June column" HeaderText="June" SortExpression="June" UniqueName="June">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="July" DataType="System.Double" FilterControlAltText="Filter July column" HeaderText="July" SortExpression="July" UniqueName="July">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="August" DataType="System.Double" FilterControlAltText="Filter August column" HeaderText="Aug" SortExpression="August" UniqueName="August">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="September" DataType="System.Double" FilterControlAltText="Filter September column" HeaderText="Sep" SortExpression="September" UniqueName="September">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="October" DataType="System.Double" FilterControlAltText="Filter October column" HeaderText="Oct" SortExpression="October" UniqueName="October">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="November" DataType="System.Double" FilterControlAltText="Filter November column" HeaderText="Nov" SortExpression="November" UniqueName="November">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="December" DataType="System.Double" FilterControlAltText="Filter December column" HeaderText="Dec" SortExpression="December" UniqueName="December">
<ColumnValidationSettings>
<ModelErrorMessage Text="" />
</ColumnValidationSettings>
</telerik:GridBoundColumn>
</Columns>
<EditFormSettings>
<EditColumn UniqueName="EditCommandColumn1" FilterControlAltText="Filter EditCommandColumn1 column"></EditColumn>
</EditFormSettings>
</MasterTableView>
</telerik:RadGrid>
Radoslav
Telerik team
 answered on 10 Jun 2014
8 answers
824 views
Hello,
  I am using radgrid to display the data. I want to set the background colour of the parent row of the detail table in the rad grid.I want the colour from the start (extreme left) so that it covers the expandcol cell of master table too.
Please suggest.
Konstantin Dikov
Telerik team
 answered on 10 Jun 2014
1 answer
468 views
hi

I am always getting file count 0 and i don't know why? Is there anything i need to add in the web config file? Or is there anything that i may have missed? Please help. Thanks a lot

<telerik:RadAsyncUpload ID="upload" runat="server" AllowedFileExtensions="jpg,png,gif" Skin="Metro" InputSize="50">
                                <Localization Select="Browse" />
                            </telerik:RadAsyncUpload>

Protected Sub btnUpload_Click(sender As Object, e As EventArgs) Handles btnUpload.Click
        Dim stdWidth As Integer
        Dim stdHeight As Integer
        Dim filenameext As String = "None"
        Try
            Dim i As Integer = upload.UploadedFiles.Count
            If upload.UploadedFiles.Count > 0 Then
                For Each f As UploadedFile In upload.UploadedFiles
                    Dim filename As String = Session("accountid").Replace("-", "0")
                    Dim target As String = Server.MapPath(filename)
                    Dim filepath As String = "~/images/pic" & filename
                    If Not Directory.Exists(target) Then
                        Directory.CreateDirectory(Server.MapPath(filepath))
                    End If

                    Using originalimage As New Bitmap(f.InputStream)

                        Dim NewSize As System.Drawing.Size = New System.Drawing.Size(stdWidth, stdHeight)
                        Dim newimg As New Bitmap(NewSize.Width, NewSize.Height, PixelFormat.Format16bppRgb555)
                        Dim g As Graphics = Graphics.FromImage(newimg)
                        g.InterpolationMode = InterpolationMode.HighQualityBicubic
                        g.CompositingQuality = CompositingQuality.HighQuality
                        g.SmoothingMode = SmoothingMode.HighQuality
                        g.DrawImage(originalimage, New Rectangle(0, 0, 120, 120))
                        newimg.Save(Path.Combine(Server.MapPath(filepath), filename + f.GetExtension))
                        g.Dispose()
                        originalimage.Dispose()

                    End Using
                Next
            Else
                filenameext = "None"
            End If
        Catch ex As Exception
         
        End Try
    End Sub
Plamen
Telerik team
 answered on 10 Jun 2014
1 answer
108 views
Hi

I have a tree view inside a radcomboBox. This contains a list of location some 2 deep some 3.

Is it possible to collapse the 3rd level so that the top 2 are expanded, only the lower levels (if any exist) are collapsed.

Andy
Plamen
Telerik team
 answered on 10 Jun 2014
1 answer
160 views
Hi,

I am trying to get a RadTreeView to display some very basic data from a SQL Database.

The data is already filtered from the SQL Server so what ever the SQL Server finds, I want to display it all. There is no sort of Row 1 links with Row 2. They are all unique.
The format of the query is
ID, Date, Description.

What I am trying to do is get the Date displayed in the first node, and when it has been clicked, I would want the Description to be down below it.

I have attached a sample image on how it looks now.

My current code is very basic which is below.

<telerik:RadTreeView runat="server" ID="RadTreeView2" Skin="Metro" DataSourceID="GetNotesTicket" datatextfield="Date">
 
                                          
                                       </telerik:RadTreeView>




I have played around with trying to use DataBindings and Notes. As well as trying to use DataFieldID, DataValueField but still not happening.

I ideally would want to display it in a Template the Description so that the user can edit the data using a RadFormWindow so I would be putting some buttons in there to.

This is the closest example I can find on how I want it to work until I start looking at the button clicks. Link

Any help would be useful.

Thanks,




 












Plamen
Telerik team
 answered on 10 Jun 2014
1 answer
170 views

I am getting a strange error when I try to insert records on a sub radgrid and I still have one other to build in yet.  What happens is that it grabs all the fields and inserts into the database just fine, but when it rebinds it tells me that the intPositionId from the sub table does not exist.  The following is the error that it gieves me.  This is the PK of of sub table and is inserted fine, like I said its just on rebinding of the table that it goes whacky, but if I leave page and come back normal everything I inserted is there and it works just fine.  It has something to do with the postback and rebind.  If I take out postback rebind it works just fine but then the data inserted is not there.


if (e.CommandName == RadGrid.PerformInsertCommandName && e.Item.OwnerTableView.Name == "Positions")
       {
           GridEditableItem item = e.Item as GridEditableItem;
           GridDataItem parentItem = e.Item.OwnerTableView.ParentItem;
           //int sectionId = Convert.ToInt32(item.OwnerTableView.DataKeyValues[e.Item.ItemIndex]["intSectionId"]);
           int secId = Convert.ToInt32(parentItem.OwnerTableView.DataKeyValues[parentItem.ItemIndex]["intSectionId"]);
           TextBox descrip = (TextBox)item.FindControl("txtdescription");
           TextBox scale = (TextBox)item.FindControl("txtScale");
           TextBox posType = (TextBox)item.FindControl("txtPosType");
           TextBox grade = (TextBox)item.FindControl("txtGrade");
 
           sql = "Execute usp_InsertPosition " + secId + ", '" + c.SanitizeString(descrip.Text) + "', '" + c.SanitizeString(scale.Text) + "', '" + c.SanitizeString(posType.Text) + "', '" + c.SanitizeString(grade.Text) + "'";
 
           c.InsertUpdateDelete(sql);
           myradGrid.Rebind();  """"""If I remove works fine but in sub grid gives below error.
       }


intPositionId is neither a DataColumn nor a DataRelation for table .
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
 
Exception Details: System.ArgumentException: intPositionId is neither a DataColumn nor a DataRelation for table .
 
Source Error:
 
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 
 
Stack Trace:
 
 
[ArgumentException: intPositionId is neither a DataColumn nor a DataRelation for table .]
   System.Data.DataRowView.get_Item(String property) +1353926
   Telerik.Web.UI.GridTableView.PopulateDataKey(Object dataItem, DataKey key, String name) +86
   Telerik.Web.UI.GridTableView.PopulateDataKeys(Object dataItem) +194
 
[GridException: There was a problem extracting DataKeyValues from the DataSource. Please ensure that DataKeyNames are specified correctly and all fields specified exist in the DataSource.]














































Princy
Top achievements
Rank 2
 answered on 10 Jun 2014
3 answers
405 views
How can I redirect the user to a required page on radalert. This is my radalert

string scriptstring = "radalert('You must save Location for Employee..', 250, 80,'Information');";
                        ScriptManager.RegisterStartupScript(this, this.GetType(), "radalert", scriptstring, true);
Here after clicking Ok I would like to redirect the user to that particular page can some one help me
Shinu
Top achievements
Rank 2
 answered on 10 Jun 2014
8 answers
140 views
Hello, I have created a web part using a RadScheduler and have followed all the instructions to add RadAjaxManager support for the scheduler.

This all works fine but I have noticed an issue with the advanced edit/insert form.

The scheduler is configured to use the advanced form (StartInsertingInAdvancedForm) and when I double click a time slot, the advanced editor opens up.

However, if a user forgets to enter text in the Subject textbox and clicks Save, the Subject textbox border changes to red to prompt the user to enter the subject text. But once this has happened, clicking on Save, Cancel or the X to close the advanced edit form has no effect at all. Nothing happens. And due to the modal nature of the advanced edit form, the only way to go back to the scheduler itself is to refresh the page, losing any changes the user has made.

I have tested this without the AjaxManager and this issue does not appear - so must be to do with ajaxifying the scheduler.

Any ideas why this might happen?

Thanks,
Jonathan
Plamen
Telerik team
 answered on 10 Jun 2014
Narrow your results
Selected tags
Tags
+? more
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Shiori
Top achievements
Rank 2
Iron
Tien
Top achievements
Rank 1
Iron
Robert
Top achievements
Rank 1
Rob
Top achievements
Rank 4
Bronze
Bronze
Iron
Geoff
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?