Telerik Forums
UI for ASP.NET AJAX Forum
1 answer
115 views
Hi Team,

I have a RadGrid with the NestedView Template. So on Expansion of Row in a Grid, We wll have TabStrip control with 5 tabs,
Now i need to iterate the Rows in the Grid and find which row is expanded and what tab is selected at client side.
Currently i am able to find which row is expanded , but when i try to get  NestedViews length it is returing as 0 . Could you please help to get the NestedView items at client side.

if (rows[i].get_nestedViews().length > 0)

 {

 var nestedView = rows[i].get_nestedViews()[0];

 for (var i = 0; i < nestedView.get_dataItems().length; i++) {

 var tabstrip = nestedView.get_dataItems()[i];

 alert(tabstrip.SelectedIndex.toString());

 }

 alert(nestedView.get_name());

 }

Sreeram
Top achievements
Rank 1
 answered on 06 Jun 2012
1 answer
62 views
Hello,

I am having multiple grids and I am using Item Created event for all the grids.

My Scenario is, I want to make some columns visible/Invisible on creating Grid.

How can I handle multiple grid columns in ItemCreated EventHandler.

TIA
Shinu
Top achievements
Rank 2
 answered on 06 Jun 2012
3 answers
145 views
Hello
I Use GridButton Column For Delete An Row.I Want Show Row Info(For Example ProductID)  In PopUp With Rad Window And Then Perform Delete Command.
And My Source Is:
<telerik:RadWindowManager ID="RadWindowManager" runat="server"
        Animation="Slide" Skin="Vista"
    VisibleStatusbar="false" ShowContentDuringLoad="false" ReloadOnShow="true"
        Title="Confirm" />
     
        <telerik:RadGrid ID="RadGrid1" runat="server"
        DataSourceID="SqlDataSource1" GridLines="Vertical" Skin="Sunset" Width="99%"
            AutoGenerateColumns="False" AllowFilteringByColumn="True"
            oneditcommand="RadGrid1_EditCommand"
            onupdatecommand="RadGrid1_UpdateCommand"
            ondeletecommand="RadGrid1_DeleteCommand"
            oninsertcommand="RadGrid1_InsertCommand"
            onneeddatasource="RadGrid1_NeedDataSource" AllowSorting="True"
            AllowPaging="True" onitemcreated="RadGrid1_ItemCreated"
            onprerender="RadGrid1_PreRender" onitemcommand="RadGrid1_ItemCommand"
            Font-Names="Rod" Font-Overline="False" onitemdatabound="RadGrid1_ItemDataBound">
            <GroupingSettings CaseSensitive="false"  />
            <ClientSettings>
                <Selecting AllowRowSelect="True" />
            </ClientSettings>
        <MasterTableView DataKeyNames="ProductID"
                        DataSourceID="SqlDataSource1" CommandItemDisplay="Top"   Font-Names="Tahoma"
                PageSize="20">
        <RowIndicatorColumn>
        <HeaderStyle Width="20px"></HeaderStyle>
        </RowIndicatorColumn>
 
        <ExpandCollapseColumn>
        <HeaderStyle Width="20px"></HeaderStyle>
        </ExpandCollapseColumn>
            <Columns>
            <telerik:GridTemplateColumn UniqueName="TemplateColumn" HeaderText="شماره سطر">
                        <ItemTemplate>
                            <asp:Label ID="numberLabel" runat="server" />
                        </ItemTemplate>
                    </telerik:GridTemplateColumn>
               <telerik:GridBoundColumn DataField="ProductID" HeaderText="سریال محصول"
            ReadOnly="True" SortExpression="ProductID" UniqueName="ProductID">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="MaxUse" DataType="System.Byte"
            HeaderText="حداکثر استفاده" SortExpression="MaxUse" UniqueName="MaxUse">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Used" DataType="System.Byte"
            HeaderText="تعداد استفاده" SortExpression="Used" UniqueName="Used">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn Visible="false" DataField="Status" DataType="System.Byte"
            HeaderText="وضعیت" SortExpression="Status" UniqueName="Status">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="Description" DataType="System.Byte"
            HeaderText="توضیحات" SortExpression="Description" UniqueName="Description">
        </telerik:GridBoundColumn>
         <telerik:GridBoundColumn DataField="LastEditDate" DataType="System.Byte"
            HeaderText="آخرین ویرایش" SortExpression="LastEditDate" UniqueName="LastEditDate">
        </telerik:GridBoundColumn>
        <telerik:GridBoundColumn DataField="LastEditor" DataType="System.Byte"
            HeaderText="آخرین ویرایشگر" SortExpression="LastEditor" UniqueName="LastEditor">
        </telerik:GridBoundColumn>
        <telerik:GridButtonColumn HeaderText="حذف محصول" ConfirmText="محصول مورد نظر حذف گردد؟"
                    ImageUrl="~/images/delete.png" ButtonType="ImageButton" ItemStyle-Width="30px"
                    CommandName="Delete" UniqueName="DeleteColumn" ConfirmDialogType="RadWindow"
                    ConfirmTitle="تایید حذف محصول" ItemStyle-BorderStyle="None">
                    <ItemStyle BorderStyle="None" Width="30px"></ItemStyle>
                    </telerik:GridButtonColumn>
        <telerik:GridButtonColumn HeaderText="ویرایش محصول"
                    ImageUrl="~/images/Edit.png" ButtonType="ImageButton" ItemStyle-Width="30px"
                    CommandName="Edit" UniqueName="EditColumn"
                    ItemStyle-BorderStyle="None">
                    <ItemStyle BorderStyle="None" Width="30px"></ItemStyle>
                    </telerik:GridButtonColumn>
            </Columns>
 
My DeleteColumn Is "DeleteColumn".Any One Can Help Me To Show Row Info  (ProductID) In Delete PopUp Confirmation?
Thanks
PINCO
Top achievements
Rank 1
 answered on 06 Jun 2012
1 answer
177 views
I have a rad combobox in a user control that is rendered inside the content template of a RadWindow....

<telerik:RadWindow ID="popupWindow" VisibleOnPageLoad="false" runat="server">
    <ContentTemplate>
        <!-- Add Any UserControls For Server Side Show/Hide here. -->
        <uc:CaseFlags runat="server" ID="ucCaseFlags" Visible="false" />
    </ContentTemplate>
</telerik:RadWindow>

Initially, when i click in the area for the rad combobox the drop down appeared behind the radwindow, so i added a high value ZIndex value, and now it appears in the correct location.

<div>
    <telerik:RadComboBox ID="comboFlags" runat="server" Height="140px" Width="200px" ZIndex="10000">
    </telerik:RadComboBox>      
 
</div>


However, if you open the drop down, then move the rad window the drop down part of the rad combobox doesnt remain inside the rad window ...

You can see an example of the result in the attached screen capture.



Is there a fix/work around to fix this problem....
Princy
Top achievements
Rank 2
 answered on 06 Jun 2012
1 answer
152 views
Hi,

I am trying to delete a row with the same code in the Telerik code sample, but my DataKeyValues is always empty.

Here is my code:

<telerik:RadGrid ID="gridNouvOrdo" runat="server" CellSpacing="0" GridLines="None">
    <FilterMenu EnableImageSprites="False">
    </FilterMenu>
    <ClientSettings>
        <Selecting CellSelectionMode="None"></Selecting>
    </ClientSettings>
    <MasterTableView CommandItemDisplay="Top">
        <CommandItemSettings ExportToPdfText="Export to PDF"></CommandItemSettings>
        <RowIndicatorColumn Visible="True" FilterControlAltText="Filter RowIndicator column">
            <HeaderStyle Width="20px"></HeaderStyle>
        </RowIndicatorColumn>
        <ExpandCollapseColumn Visible="True" FilterControlAltText="Filter ExpandColumn column">
            <HeaderStyle Width="20px"></HeaderStyle>
        </ExpandCollapseColumn>
        <Columns>
            <telerik:GridEditCommandColumn FilterControlAltText="Filter EditCommandColumn column"
                ButtonType="ImageButton" EditText="Modifier" Resizable="False" HeaderStyle-Width="46px"
                EditImageUrl="Images/Icons/006-Write-New-Icon.png">
                <HeaderStyle Width="32px"></HeaderStyle>
            </telerik:GridEditCommandColumn>
            <telerik:GridButtonColumn CommandName="Delete" ConfirmText="Êtes-vous sûr de vouloir supprimer?"
                FilterControlAltText="Filter column column" Text="Supprimer" UniqueName="colDelete"
                ButtonType="ImageButton" ImageUrl="Images/Icons/059-Close-Delete-circle-Icon.png"
                ConfirmDialogType="Classic">
                <HeaderStyle Width="32px"></HeaderStyle>
            </telerik:GridButtonColumn>
            <telerik:GridBoundColumn FilterControlAltText="Filter colMedicament column" HeaderText="Médicament"
                UniqueName="colMedicament" DataField="NomMedicament">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn FilterControlAltText="Filter colPoso1 column" HeaderText="Posologie 1"
                UniqueName="colPoso1" DataField="Posologie">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn FilterControlAltText="Filter colPoso2 column" HeaderText="Posologie 2"
                UniqueName="colPoso2" DataField="Posologie2">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn FilterControlAltText="Filter colQte column" HeaderText="Qté."
                UniqueName="colQte" ShowFilterIcon="false" DataField="Quantite">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn FilterControlAltText="Filter colRen column" HeaderText="Ren."
                UniqueName="colRen" ShowFilterIcon="false" DataField="Renouvellements">
            </telerik:GridBoundColumn>
            <telerik:GridBoundColumn FilterControlAltText="Filter colComment column" HeaderText="Commentaire"
                UniqueName="colComment" DataField="Commentaire">
            </telerik:GridBoundColumn>
        </Columns>
        <EditFormSettings>
            <EditColumn FilterControlAltText="Filter EditCommandColumn column">
            </EditColumn>
        </EditFormSettings>
    </MasterTableView>
</telerik:RadGrid>

Protected Sub gridNouvOrdo_NeedDataSource(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridNeedDataSourceEventArgs) Handles GridNouvOrdo.NeedDataSource
        gridNouvOrdo.DataSource = CurrentPropsBCM.OrdosManuelles
End Sub
 
Protected Sub gridNouvOrdo_DeleteCommand(ByVal sender As Object, ByVal e As Telerik.Web.UI.GridCommandEventArgs) Handles GridNouvOrdo.DeleteCommand
    Dim id = e.Item.OwnerTableView.DataKeyValues(e.Item.ItemIndex)
 
End Sub

My DeleteCommand event currently do nothing, because it fail on the single line with a IndexOutOfBound.

Am I missing something? Thanks.
Shinu
Top achievements
Rank 2
 answered on 06 Jun 2012
0 answers
84 views
i have a radgrid within a radajaxpanel within an ajax control toolkit tab which is populated based upon the selection of a row from another tab. when i click to the first described grid, selection fails even though selection is enabled. when i click a row's edit button and then cancel, selection works.

the insert row button has been redefined to open a radwindow to select a row to populate the parent grid:
<CommandItemTemplate>
      <a href="#" onclick="return openWin();">Add New Registrant</a> <a href="#"
           onclick="return refreshGrid();" style="float: right">Refresh</a>
</CommandItemTemplate>

this alteration shouldn't matter but i have included it in the event that it does.

why does the grid not select when first loaded? i have seen at 2 other threads on this subject without any obvious resolution.




tony
Top achievements
Rank 1
 asked on 06 Jun 2012
0 answers
87 views
I am using client side binding to the grid. When I first load the page, I get a single call to my GetData() web service method as expected. If I click a number in the pager, however, I get the first call and data returned as expected, but then the grid calls the data function again and reloads the data with the parameters set as though the first page is being requested, which means the grid can never show pages other than the first page.

Your documentation has guidance on how to keep this from happening, but I have not been able to get any of the techniques to work:

http://www.telerik.com/help/aspnet-ajax/grid-custom-paging.html

I also tried this technique:

http://demos.telerik.com/aspnet-ajax/grid/examples/client/declarativedatabinding/defaultcs.aspx

But for some reason my GetDataAndCount() web service method was never called. The example does not say how the ClientSettings DataBinding properties should be set in this instance, so that might be the problem. How should they be set? Are there any other properties on the grid that need to be set to make this work, or is there a way to tell from the client side object model that the grid is calling the client side data binding function for the second time so that the argument can be set to cancel?

Another related question: I can use

sender.get_masterTableView().get_columns()[0].set_visible(false);
sender.get_masterTableView().get_columns()[0].Display = false;

to hide a column client side during the data binding call. But if I set

sender.get_masterTableView().get_columns()[0].set_visible(true);
sender.get_masterTableView().get_columns()[0].Display = true;

the column does not reappear. Is there another function I should be calling, or should this be done during another event? I would like to manage the visibility of certain columns client side. Is this possible?
John
Top achievements
Rank 1
 asked on 06 Jun 2012
0 answers
102 views
I would like to nest a RadGrid within the ItemTemplate/AlternatingItemTemplate of a RadListView and then use a ListView dataitem as a variable for the select statement that populates the RadGrid datasource.

For example:
______________________________________________
User Name: jdoe
First Name: John
Last Name: Doe
______________________________________
|_UserName__|__Workstation__|_LastLogOn_|
|     jdoe           |   PC103              |     8:00 am   |
______________________________________

______________________________________________
User Name: ssmith
First Name: Sally
Last Name: Smith
______________________________________
|_UserName__|__Workstation__|_LastLogOn_|
|      ssmith       |           PC107     |     8:05 am   |
______________________________________

______________________________________________


Is this possible?


Allan
Top achievements
Rank 2
 asked on 05 Jun 2012
0 answers
51 views
Hello,

I'm cannot get my ajaxloadingpanel to appear during an ajax event for my webusercontrol edit for for my radgrid.

My grid is ajaxified by an ajaxmanager and has a specified default ajaxloadingpanel.  The loadingpanel displays during grid sorts and filtering.

I am using an usercontrol as the editform (editformtype=webusercontrol).  The form has several controls on it that I ajaxify by adding ajaxsettings items in the page_load of the usercontrol.  The ajax update behavior seems to be fine (when I change a combo box, the other form controls update the way I want them to).  What is missing is the display of the AjaxLoadingPanel that is set as the default loading panel for the ajaxmanager on the page.

Is there something more specific I must do to get it to display over the updating controls of my edit form ?

Thanks.

Mike
Mike
Top achievements
Rank 1
 asked on 05 Jun 2012
2 answers
245 views
I would like to bind a radgrid that is within an itemtemplate of a list view. Nothing complicated. Just a grid in a list view. The grid will be bound from code behind and really has no dependance on the listview. The listview simply holds the grid.

ASPX:
<telerik:RadListView ID="RadListView1" runat="server">
<LayoutTemplate>
<div>
<div ID="itemPlaceholder" runat="server">
</div>
</div>
</LayoutTemplate>
<ItemTemplate>
<div>
<table cellpadding="0" cellspacing="0" style="width: 700px">
<tr>
<td style="background-color: #597791">
<img alt="" src="../../../images/spacer_1h20w.png"
style="width: 20px; height: 1px" />
</td>
</tr>
</table>
<table style="width: 100%">
<tr>
<td class="tbltd" style="width: 90px; color: #00B000;">
Bitech ID:</td>
<td style="width: 221px">
<strong>
<asp:Label ID="lbl_IDBitech" runat="server"
Text='<%# Eval("IDBitech") %>' ForeColor="#00B000" />
</strong>
</td>
<td class="tbltd" style="width: 136px">
Site:</td>
<td>
<asp:Label ID="lbl_Site" runat="server" Text='<%# Eval("Site") %>' />
</td>
</tr>
<tr>
<td class="tbltd" style="width: 90px">
Staff ID:</td>
<td style="width: 221px">
<asp:Label ID="lbl_StaffID" runat="server" Text='<%# Eval("IDStaff") %>' />
</td>
<td class="tbltd" style="width: 136px">
Phone:</td>
<td>
<asp:Label ID="lbl_IPPhone" runat="server" Text='<%# Eval("PhoneIP") %>' />
</td>
</tr>
<tr>
<td class="tbltd" style="width: 90px">
User Name:</td>
<td style="width: 221px">
<asp:Label ID="lbl_UserName" runat="server" Text='<%# Eval("UserName") %>' />
</td>
<td class="tbltd" style="width: 136px">
Email:</td>
<td>
<asp:Label ID="lbl_Email" runat="server" Text='<%# Eval("EmailAddress") %>'></asp:Label>
</td>
</tr>
<tr>
<td class="tbltd" style="width: 90px">
Last Name:</td>
<td style="width: 221px">
<asp:Label ID="lbl_LastName" runat="server" Text='<%# Eval("LastName") %>' />
</td>
<td class="tbltd" style="width: 136px">
</td>
<td>
</td>
</tr>
<tr>
<td class="tbltd" style="width: 90px">
First Name:</td>
<td style="width: 221px">
<asp:Label ID="lbl_FirstName" runat="server" Text='<%# Eval("FirstName") %>' />
</td>
<td class="tbltd" style="width: 136px">
</td>
<td>
</td>
</tr>
<tr>
<td class="tbltd" style="width: 90px">
Title:</td>
<td style="width: 221px">
<asp:Label ID="lbl_Title" runat="server" Text='<%# Eval("JobTitle") %>' />
</td>
<td class="tbltd" style="width: 136px">
</td>
<td>
</td>
</tr>
<tr>
<td class="tbltd" style="width: 90px">
Password:</td>
<td style="width: 221px">
<asp:Label ID="lbl_Password" runat="server" Text='<%# Eval("Password") %>' />
</td>
<td class="tbltd" style="width: 136px">
</td>
<td>
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" style="width: 100%">
<tr>
<td style="background-color: #597791">
<img alt="" src="../../../images/spacer_1h20w.png"
style="width: 20px; height: 1px" />
</td>
</tr>
</table>
<table cellpadding="0" cellspacing="0" style="width: 650px">
<tr>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
<td>
</td>
</tr>
<tr>
<td>
<table cellpadding="0" cellspacing="0"
style="width: 105px; height: 24px; background-image: url('../../../images/rad_button.gif')">
<tr>
<td class="rad_button" style="text-align: center">
<asp:HyperLink ID="HyperLink2" runat="server" CssClass="rad_button"
NavigateUrl='<%# "user_details.aspx?UserName=" + Eval("UserName") %>'>Details</asp:HyperLink>
</td>
</tr>
</table>
</td>
<td>
<table cellpadding="0" cellspacing="0"
style="width: 105px; height: 24px; background-image: url('../../../images/rad_button.gif')">
<tr>
<td class="rad_button" style="text-align: center">
<asp:HyperLink ID="HyperLink1" runat="server"
NavigateUrl='<%# "user_change_site.aspx?UserName=" + Eval("UserName")%>'>Change Site</asp:HyperLink>
</td>
</tr>
</table>
</td>
<td>
<table cellpadding="0" cellspacing="0"
style="width: 105px; height: 24px; background-image: url('../../../images/rad_button.gif')">
<tr>
<td class="rad_button" style="text-align: center">
<asp:HyperLink ID="HyperLink3" runat="server"
NavigateUrl='<%# "user_change_name.aspx?UserName=" + Eval("UserName")%>'>Change Last Name</asp:HyperLink>
</td>
</tr>
</table>
</td>
<td>
<table cellpadding="0" cellspacing="0"
style="width: 105px; height: 24px; background-image: url('../../../images/rad_button.gif')">
<tr>
<td class="rad_button" style="text-align: center">
<asp:HyperLink ID="HyperLink4" runat="server"
NavigateUrl='<%# "user_disable.aspx?UserName=" + Eval("UserName")%>'>Disable</asp:HyperLink>
</td>
</tr>
</table>
</td>
<td>
<table cellpadding="0" cellspacing="0"
style="width: 105px; height: 24px; background-image: url('../../../images/rad_button.gif')">
<tr>
<td class="rad_button" style="text-align: center">
<asp:HyperLink ID="HyperLink5" runat="server"
NavigateUrl='<%# "user_delete.aspx?UserName=" + Eval("UserName")%>'>Delete</asp:HyperLink>
</td>
</tr>
</table>
</td>
</tr>
</table>
<p>
<telerik:RadGrid ID="rgd_AreiesLog1" runat="server"
AutoGenerateColumns="False" GridLines="None" Skin="WebBlue" Width="500px">
<MasterTableView DataKeyNames="usr" NoMasterRecordsText="No Aeries data found.">
<CommandItemSettings />
<Columns>
<telerik:GridBoundColumn DataField="dt" HeaderStyle-HorizontalAlign="Center"
HeaderText="Login Date" ItemStyle-HorizontalAlign="Center" SortExpression="dt"
UniqueName="dt">
<HeaderStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="co" HeaderStyle-HorizontalAlign="Center"
HeaderText="Aeries Version" ItemStyle-HorizontalAlign="Center"
SortExpression="co" UniqueName="co">
<HeaderStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center" />
</telerik:GridBoundColumn>
<telerik:GridBoundColumn DataField="ip" HeaderStyle-HorizontalAlign="Center"
HeaderText="IP Address" ItemStyle-HorizontalAlign="Center" SortExpression="ip"
UniqueName="ip">
<HeaderStyle HorizontalAlign="Center" />
<ItemStyle HorizontalAlign="Center" />
</telerik:GridBoundColumn>
</Columns>
</MasterTableView>
</telerik:RadGrid>
<br />
<br />
<br />
</p>
</div>
</ItemTemplate>
</telerik:RadListView>


Here is what I am attempting in code behind:
'***********************************************************************************************************************
'Search for users by UserName
'***********************************************************************************************************************
Protected Sub rcb_Users_SelectedIndexChanged(o As Object, e As Telerik.Web.UI.RadComboBoxSelectedIndexChangedEventArgs) Handles rcb_Users.SelectedIndexChanged
Dim cn As SqlConnection = New SqlConnection(ConfigurationManager.ConnectionStrings("IT_CentralConnectionString").ToString)
cn.Open()
Dim SqlCmd As SqlCommand
SqlCmd = New SqlCommand("SELECT DisplayValue FROM ITC_Options WHERE NAME = 'AeriesDefaultYear'", cn)
Session("AeriesYear") = CType(SqlCmd.ExecuteScalar, String)
cn.Close()
rgd_User_List.DataSource = UserDetails_UserName()
rgd_AreiesLog.DataSource = AreiesLog_UserName()
rgd_PC_List.DataSource = WorkstationDetails_UserName()
rgd_User_List.DataBind()
rgd_AreiesLog.DataBind()
rgd_PC_List.DataBind()
RadListView1.DataSource = UserDetails_UserName()
RadListView1.DataBind()
Dim rgd_AreiesLog1 As RadGrid = DirectCast(RadListView1.ItemTemplate.FindControl("rgd_AreiesLog1"), RadGrid)
rgd_AreiesLog1.DataSource = AreiesLog_UserName()
rgd_AreiesLog1.DataBind()
End Sub
Private Function AreiesLog_UserName() As DataTable
Dim DatabaseName As String = Session("AeriesYear")
Dim connectionString As String = DirectCast(ConfigurationManager.ConnectionStrings("EagleAdmin_ConnectionString").ConnectionString, String)
Dim connection As New SqlConnection(connectionString)
Dim command As New SqlCommand(connectionString, connection)
command = New SqlCommand("aa_user_info", connection)
command.CommandType = CommandType.StoredProcedure
command.Parameters.Add("@DBName", SqlDbType.VarChar).Value = DatabaseName
If rcb_Users.Text = " " Then
command.Parameters.Add("@UserName", SqlDbType.VarChar).Value = "TUSTIN_NT\" + rcb_Users.SelectedValue
Else
command.Parameters.Add("@UserName", SqlDbType.VarChar).Value = "TUSTIN_NT\" + rcb_Users.Text
End If
command.Connection.Open()
Dim myDataAdapter As New SqlDataAdapter(command)
Dim myDataSet As New DataSet
Dim dtData As New DataTable
myDataAdapter.Fill(myDataSet)
Return myDataSet.Tables(0)
command.Connection.Close()
End Function
Private Function UserDetails_UserName() As DataTable
Dim connectionString As String = DirectCast(ConfigurationManager.ConnectionStrings("IT_CentralConnectionString").ConnectionString, String)
Dim conn As New SqlConnection(connectionString)
Dim comm As New SqlCommand("SELECT [UserName], [IDBitech], [IDStaff], [Password], [LastName], [Site], [JobTitle], [FirstName], [EmailAddress], [PhoneIP] FROM [vw_ADUsersExtended] WHERE ([UserName] LIKE @UserName + '%') ORDER BY UserName", conn)
comm.Connection.Open()
If rcb_Users.Text = " " Then
comm.Parameters.Add("@UserName", SqlDbType.VarChar).Value = rcb_Users.SelectedValue
Else
comm.Parameters.Add("@UserName", SqlDbType.VarChar).Value = rcb_Users.Text
End If
Dim myDataAdapter As New SqlDataAdapter(comm)
Dim myDataSet As New DataSet
Dim dtData As New DataTable
myDataAdapter.Fill(myDataSet)
Return myDataSet.Tables(0)
comm.Connection.Close()
End Function
Private Function WorkstationDetails_UserName() As DataTable
Dim connectionString As String = DirectCast(ConfigurationManager.ConnectionStrings("IT_CentralConnectionString").ConnectionString, String)
Dim conn As New SqlConnection(connectionString)
Dim comm As New SqlCommand("SELECT [LogonTime], [Host_Name], [IP_Address], [Boot_Time] FROM [vw_BG_ADSI_Extended] WHERE ([UserName] LIKE @UserName + '%') ORDER BY LogonTime DESC", conn)
comm.Connection.Open()
If rcb_Users.Text = " " Then
comm.Parameters.Add("@UserName", SqlDbType.VarChar).Value = rcb_Users.SelectedValue
Else
comm.Parameters.Add("@UserName", SqlDbType.VarChar).Value = rcb_Users.Text
End If
Dim myDataAdapter As New SqlDataAdapter(comm)
Dim myDataSet As New DataSet
Dim dtData As New DataTable
myDataAdapter.Fill(myDataSet)
Return myDataSet.Tables(0)
comm.Connection.Close()
End Function


Any help much appreciated.
Allan
Top achievements
Rank 2
 answered on 05 Jun 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?