Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
118 views
I have a radgrid using advanced databinding to connect to a linq to sql datasource.  The grid allows the user to edit the data stored in a table in a sql database.  One of the fields is a foreign key to another table.  The grid will properly catch invalid values when editing a row and not allow the invalid value to be written to the database, however the invalid value still appears in the radgrid until the user clicks the grid's refresh button.  This is a problem because the user see's invalid values saved to the grid even though they are not saved to the database.

Here is the code behind for the update command
Protected Sub RadGrid1_UpdateCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles RadGrid1.UpdateCommand
    Dim item As GridEditableItem = TryCast(e.Item, GridEditableItem)
    Dim ein = item.GetDataKeyValue("EIN").ToString()
    Dim distributor = DbContext.Distributors.Where(Function(n) n.EIN = ein).FirstOrDefault()
    item.UpdateValues(distributor)
    Dim channel = DbContext.Channels.Where(Function(n) n.ChannelId = distributor.ChannelId).FirstOrDefault()
    If channel Is Nothing Then
        displayError("Distributor was not updated. Please enter a valid channelId.")
        Else()
        Try
            DbContext.SubmitChanges()
        Catch ex As Exception
            displayError("Record cannot be updated")
 
        End Try
 
    End If
End Sub

The value that is causing the problem is the channelId.  I have written code to check if the channel exists and display a popup if the channel doesn't exist.  However, the grid still retains the invalid value.

Thanks in advance,
Jonathan Clark
Jonathan
Top achievements
Rank 1
 answered on 02 Apr 2012
2 answers
195 views

How to set the backcolor ... it comes out white no matter what I try...

<telerik:RadNotification ID="NotifyNotClockedIn" runat="server" AutoCloseDelay="10000"
       VisibleTitlebar="false" Width="95%" Animation="Slide" EnableRoundedCorners="true" BackColor="Black"
       OnCallbackUpdate="NotifyNotClockedIn_Update" OnClientUpdated="OnClientUpdated"
       Height="225px" Position="TopCenter" EnableShadow="true" Title="Not Clocked In"
       AnimationDuration="5000">
Ken
Top achievements
Rank 1
 answered on 02 Apr 2012
1 answer
114 views
Hi,

I added a previous and next button outside of the grid as I wrote in this thread:
http://www.telerik.com/community/forums/aspnet-ajax/grid/add-previous-and-next-button-outside-of-grid.aspx

The previous and next button's work great.  But if the grid visible area shows 10 records and your grids page size is 50 then you have to scroll down to see the next records.   The problem is that once I'm on the 10th record and I click on the next button I go to the next record, but the scroll bar does not move with the selected record.  Is there a way to make the scrollbar move with the selected record in the grid?

My rad grid:
<telerik:RadGrid  ID="radGrid1" runat="server"
    AllowPaging="True" AllowSorting="True" CellSpacing="0" GridLines="None"
    AllowCustomPaging="True" PageSize="50"  Width="100%"
    Skin="Outlook" onneeddatasource="radGrid1_NeedDataSource"
        AutoGenerateColumns="False"  OnItemCommand="radGrid1_ItemCommand" OnPreRender="radGrid1_PreRender">
    <ExportSettings HideStructureColumns="true" />
    <ClientSettings>
    <Selecting CellSelectionMode="None" EnableDragToSelectRows="True"></Selecting>
        <Scrolling SaveScrollPosition="false"  AllowScroll="True" UseStaticHeaders="true" ScrollHeight="300px" />
    </ClientSettings>
    <MasterTableView>
 
    <Columns>
         <telerik:GridBoundColumn Visible="false" UniqueName="id"
             HeaderText="id" DataField="id">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn UniqueName="name"
            SortExpression="name" HeaderText="Name" DataField="name">
        </telerik:GridBoundColumn>
         <telerik:GridBoundColumn UniqueName="Dob"
            SortExpression="Dob" HeaderText="DOB" DataField="Dob" DataFormatString="{0:MM/dd/yyyy}">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn UniqueName="Creation_date"
            SortExpression="Creation_date" HeaderText="Request Date" DataField="Creation_date" DataFormatString="{0:MM/dd/yyyy}">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn UniqueName="Status"
            SortExpression="Status" HeaderText="Test Status" DataField="Status">
        </telerik:GridBoundColumn>
    </Columns>
    </MasterTableView>
    <ClientSettings EnablePostBackOnRowClick="true"   Selecting-AllowRowSelect="true" AllowKeyboardNavigation="true"  />
</telerik:RadGrid>


Thank you,
-Hitesh
Hitesh
Top achievements
Rank 1
 answered on 02 Apr 2012
2 answers
93 views
Hi,

I'm trying to add a previous and next button outside of the grid. I'm having some problems doing that. Can somebody give me some direction on how this is done?

Functionality:
If next button is pressed, the next record after the selected record is picked.
If previous button is pressed, the previous record from the selected record is picked.

Thank you,
-Tesh
Hitesh
Top achievements
Rank 1
 answered on 02 Apr 2012
1 answer
79 views

Hi  ,
I have a image control inside the RadDock and Problem is image size is large , then Scrolling coming for RadDock. Is there any property to Autofit the image inside the RadDock. Please help

Thanks in Advance
Jesmon Joseph

Slav
Telerik team
 answered on 02 Apr 2012
18 answers
236 views
Hi.
I have followed this example to use asp.net validation controls inside GridTemplateColumns:
http://www.telerik.com/help/aspnet-ajax/grid-validation.html

I am using the following settings for the MasterTableView:
<MasterTableView EditMode="EditForms" CommandItemDisplay="Top" InsertItemPageIndexAction="ShowItemOnCurrentPage"> 

But when both insert and editable rows are open, the validation executes for all of them. Am I the only one with this problem, or is this a known problem?

Please let me know if my explanation is insufficient.
Andrey
Telerik team
 answered on 02 Apr 2012
6 answers
187 views
I have a chart.  If scrolling is turned off, I can display short time with a 90 degree rotation on the x axis.  As soon as I turn on scrolling, the x axis text disappears.

<telerik:RadChart ID="RadChart1" AutoLayout="true"
        runat="server" Width="495px" 
        Skin="Mac">
    <ClientSettings EnableZoom="false" ScrollMode="None" XScale="2" />       
    <ChartTitle>
        <Appearance Dimensions-Margins="4%, 10px, 14px, 6%">
            <FillStyle MainColor="">
            </FillStyle>
        </Appearance>
        <TextBlock>
            <Appearance TextProperties-Color="White"
                TextProperties-Font="Verdana, 14pt">
            </Appearance>
        </TextBlock>
    </ChartTitle>
    <Legend>
        <Appearance Dimensions-Margins="1px, 2%, 12%, 1px">
            <ItemTextAppearance TextProperties-Color="White">
            </ItemTextAppearance>
            <FillStyle GammaCorrection="False" MainColor="37, 255, 255, 255">
            </FillStyle>
            <Border Color="76, 255, 255, 255" />
        </Appearance>
        <TextBlock>
            <Appearance Position-AlignedPosition="Top" TextProperties-Color="LightSkyBlue">
            </Appearance>
        </TextBlock>
    </Legend>
    <PlotArea>
        <Appearance Dimensions-Margins="18%, 24%, 22%, 10%">
        </Appearance>       
        <XAxis LayoutMode="Inside">
            <Appearance ValueFormat="ShortTime" Color="Black">
                <LabelAppearance RotationAngle="90"></LabelAppearance>
            </Appearance>
        </XAxis>
    </PlotArea>
</telerik:RadChart>

Any help will be greatly appreciated. Thanks
Karuna
Top achievements
Rank 1
 answered on 02 Apr 2012
2 answers
83 views
Hi telerik:

RadGrid can't  turn page . this is why?

Thank you.
Eyup
Telerik team
 answered on 02 Apr 2012
3 answers
113 views
Hello,

There's a programmatically created control

[ClientScriptResource("MyControls.ImageControl", "MyControls.ImageControl.js")]
public class ImageControl : Panel, IScriptControl
{
  private RadAsyncUpload AsyncUpload;
  
  protected override void OnInit(EventArgs e)
  {
    base.OnInit(e);
    AsyncUpload = new RadAsyncUpload();
    AsyncUpload.OnClientAdded = "Added";
  }
}


JS>
Type.registerNamespace("MyControls");
MyControls.ImageControl = function () {
}
MyControls.ImageControl.prototype = {
  Added: function (sender, args) {
            alert('bla');
        },
}

MyControls.ImageControl.registerClass('MyControls.ImageControl', System.Web.UI.WebControls.Panel)


At execution Time I get "Added is not defined" from here:
Sys.Application.add_init(function() { $create(Telerik.Web.UI.RadAsyncUpload, {...}

Please help me.
Max
Top achievements
Rank 1
 answered on 02 Apr 2012
1 answer
76 views
I have a RadGrid in a page.It has predictive type ahead for filtering + also has colour coding for each item in the grid.The grid also has a button for each of its items.
Since the grid is heavy , when the page is first opened and a user immmediately clicks on the button next to the any item , the grid collapses. I tried debugging this scenario and found that it was not hitting the item command on the button click in this scenario. Thus I concluded that it can be due to the fact that the grid is not completely loaded. Although this occurs infrequently.
Another situation also comes up when the page is just loaded and the user clicks on the filter to see the options available in it. In this case also it gives some error.The occurence of this error is alo not very frequent.
These scenarios only occur in case when the page is just opened.
No such cases come up when after the page is opened and the prepopulated grid is again populated with some search result i.e after a postback.

Tsvetoslav
Telerik team
 answered on 02 Apr 2012
Narrow your results
Selected tags
Tags
+? more
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Boardy
Top achievements
Rank 2
Veteran
Iron
Benjamin
Top achievements
Rank 3
Bronze
Iron
Veteran
ivory
Top achievements
Rank 1
Iron
Iron
Rob
Top achievements
Rank 3
Bronze
Bronze
Iron
ClausDC
Top achievements
Rank 2
Iron
Iron
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?