Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
94 views
Dears,
I have a Radgrid with EditMode="EditForms"
I want to prevent user from adding new record and editing another one simultaneously, I managed to check if grid has an Edit Items by using

grd.EditItems.Count. But I did not manage to check if grid has new Insert row when user try to click on GridEditCommandColumn to edit another row.

 

 

 

Princy
Top achievements
Rank 2
 answered on 28 Oct 2010
3 answers
80 views
Hi
i create the Edit from in the Codebehind, like that:
RadGridDataList.MasterTableView.EditFormSettings.EditFormType = GridEditFormType.WebUserControl;
RadGridDataList.MasterTableView.EditFormSettings.UserControlName = editViewer.ViewControl;
RadGridDataList.MasterTableView.EditFormSettings.PopUpSettings.Width = new Unit(PopUpSettingsWidth);
RadGridDataList.MasterTableView.EditFormSettings.PopUpSettings.Modal = true;

If i do that, the hole windows is locked alsow the edit form. Did anybody a idee whats worng?

Regards Markus
Dimo
Telerik team
 answered on 28 Oct 2010
3 answers
543 views
Hi.
I have grid where i want to set the column width for each column. I used the headerstyle-width and itemstyle-width for a column. Column width is set correct when the record is not in insert or edit mode. But in insert or edit mode, the column width is changing.  I have tried a lot of things, like not have a grid width, set the TableLayout to fixed, different combination of ItemStyle-width and HeaderStyle-width etc. unsuccessfully. So how can i set the column width for insert/edit mode?

the code i am using:
     <telerik:RadGrid ID="RadGrid2" runat="server" DataSourceID="LinqDataSource1" GridLines="None" Width="360px" >
        <MasterTableView AutoGenerateColumns="False" DataKeyNames="EmployeeCompanyNumber" DataSourceID="LinqDataSource1" CommandItemDisplay="Top">
        <CommandItemSettings ExportToPdfText="Export to Pdf"></CommandItemSettings>
        <RowIndicatorColumn><HeaderStyle Width="20px"></HeaderStyle></RowIndicatorColumn>
        <ExpandCollapseColumn><HeaderStyle Width="20px"></HeaderStyle></ExpandCollapseColumn>
        <Columns>                    
            <telerik:GridNumericColumn  ItemStyle-Width="70px" HeaderStyle-Width="80px" FilterControlWidth="90%" DataField="EmployeeCompanyNumber" DataType="System.Int32" HeaderText="Foretaksnr." SortExpression="EmployeeCompanyNumber" UniqueName="EmployeeCompanyNumber">
            </telerik:GridNumericColumn>
            <telerik:GridBoundColumn ItemStyle-Width="190px" HeaderStyle-Width="200px" FilterControlWidth="90%" DataField="Name" HeaderText="Navn" SortExpression="Name" UniqueName="Name" >
            </telerik:GridBoundColumn>
            <telerik:GridEditCommandColumn HeaderStyle-Width="140px" >
            </telerik:GridEditCommandColumn>
            <telerik:GridButtonColumn HeaderStyle-Width="40px" CommandName="Delete">            
            </telerik:GridButtonColumn>                   
        </Columns>
        <EditFormSettings><EditColumn UniqueName="EditCommandColumn1"></EditColumn></EditFormSettings>
        </MasterTableView>
    </telerik:RadGrid>

 



            
Dimo
Telerik team
 answered on 28 Oct 2010
5 answers
694 views
I have 2 drop downs publisher and heading. If I change the publisher and  select a heading with  a different value but the same text as the previously selected heading the selected value does not update. But if I select a completely different heading with different text and value it works fine.

Here is my code


function PublisherChanged(combo, eventArqs)
{   
    directories.clearSelection()
    headings.clearSelection();
    directories.clearItems(); 
    headings.clearItems(); 
    directories.requestItems('',false);
    headings.requestItems('',false);
                   
}



  private void PopulateHeadings(string publisherName, string text)
        {
          
            if (publisherName == "") return;
            DataTable data = GetHeadings(publisherName, text);
            bool noResults = false;
            if (data.Rows.Count == 0)
            {
                noResults = true;
                DataRow row = data.Rows.Add();
                row["value"] = "[No Results]";
                row["Id"] = "0";
            }

            headings.DataSource = GetTopN(data, 15);
            headings.DataTextField = "value";
            headings.DataValueField = "Id";
            headings.DataBind();


            if (noResults)
            {
                headings.Items[0].Enabled = false;
            }
         
        }

Is the a bug in the control or am I using the control incorrectly?
Kalina
Telerik team
 answered on 28 Oct 2010
1 answer
64 views
Hello,
I have a RadTreeView that has ExpandMode "TreeNodeExpandMode.ServerSideCallBack". I want to open branches and select a node client-side via Javascript. Is there any example on how to do this?

My target is to refresh the tree after an user right click action on a node. After the right click, I'll do a postback and refresh the tree and reselect the node also opening branches to reach selected node.
Nikolay Tsenkov
Telerik team
 answered on 28 Oct 2010
1 answer
121 views
I am trying to validate the input of a military time.  However, it always rejects whatever I enter for the time in the RadDateInput field, but the validation works just fine in a textbox.  My test code looks like:

Time: 
  <telerik:RadDateInput ID="RadDateInput1" runat="server" DateFormat="HH:mm" Width="50" /> 
  <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" 
    ErrorMessage="Invalid Time" ControlToValidate="RadDateInput1" Display="Dynamic" 
    ValidationExpression="(([01][0-9])|(2[0-3])):[0-5][0-9]" SetFocusOnError="true" /> 
  <br /> 
Time2: 
  <asp:TextBox ID="txtTime" runat="server" Width="50" />     
  <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server"
    ErrorMessage="Invalid Time2" ControlToValidate="txtTime" Display="Dynamic" 
    ValidationExpression="(([01][0-9])|(2[0-3])):[0-5][0-9]" SetFocusOnError="true" /> 
  <br />
<asp:Button ID="btnSubmit" runat="server" CausesValidation="true" Text="Submit" />

Can someone please tell me what I am doing wrong?

Many thanks!
Dimo
Telerik team
 answered on 28 Oct 2010
1 answer
101 views

Hello Telerik Team,

I have a requirement for the rad grid to export the results shown in the rad grid dynamically.
I have put this rad grid inside a user control and user control is inside the sharepoint webpart.
I have ajaxified this webpart.
I saw some blogs where it says you cant get the export functionality work if you have ajax.
I have gone through http://www.telerik.com/community/code-library/aspnet-ajax/general/export-radgrid-content-to-excel-word-csv-pdf-with-ajax-enabled.aspx
also..but it would be really helpful if you can send out a sample for ajaxified webpart to use export.
i appreciate your help and support.

Thank you,
Smith

Dimo
Telerik team
 answered on 28 Oct 2010
3 answers
186 views
Hi,

I have a RadGrid inside a RadListView (which has a page size of 1), the problem I'm having is that my RadGrid_OnNeedDataSource gets called before my RadListView_OnNeedDataSource. This is problematic because the data I need to populate my RadGrid with is dependent on the
RadListView's new DataKey: ideally in RadGrid_OnNeedDataSource I'd get the NEW DataKeyValue of the RadListView and use that to
call a stored procedure in the database.

If I try to get the RadListView's current item's datakey in RadGrid_OnNeedDataSource I always get the old RadListView item's datakey (i.e. not the one I just selected).

Is there an easy work around for this?

Regards,
-Carlo
Nikolay Rusev
Telerik team
 answered on 28 Oct 2010
3 answers
172 views
Hello,
How can I scroll automatically horizontal by script? I save the RadGrid1.GridDataDiv object status before the RadGrid change:
<script type="text/javascript">
    var usersmatrix1scrollArea;
  
    function OnClientScript(args) {
        var RadGrid1 = $find("<%= RadGrid1.ClientID %>");
        usersmatrix1scrollArea = RadGrid1.GridDataDiv;
    }
  
    function GridCreated() {
        var RadGrid1 = $find("<%= RadGrid1.ClientID %>");
        var scrollArea = RadGrid1.GridDataDiv;
  
        if (usersmatrix1scrollArea != null) {
            scrollArea = usersmatrix1scrollArea; 
        }
    }
</script>
This works only vertically, no horizontal. How can I scroll to the correct Item horizontal?

Reiner
Dimo
Telerik team
 answered on 28 Oct 2010
1 answer
82 views
Hello!

I need to create chart prommatically with next cridentials:
 - Bar type
 - XAxis values type should be string
 - Zoom and scroll functionality should be present on both axes
In general, my chart should be like chart in attachment.

Could You help me, please?

Thanks,
Volodya.
Volodya Bychko
Top achievements
Rank 1
 answered on 28 Oct 2010
Narrow your results
Selected tags
Tags
+? more
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Top users last month
Ambisoft
Top achievements
Rank 2
Iron
Pascal
Top achievements
Rank 2
Iron
Matthew
Top achievements
Rank 1
Sergii
Top achievements
Rank 1
Andrey
Top achievements
Rank 1
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?