.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
david stephan
Gaurav Pal
Post New Web Links

datagrid item.ItemIndex keep selecting the wrong row number

Posted By:      Posted Date: September 01, 2010    Points: 0   Category :ASP.Net
I apologize in advance for my poor english:1. I have a dropdownList within my datagrid and its already populated fine (22 rows in my datagrid)2. The select item for the 21 row is the same as the select item of the 22 row3. When trying to do selectedIndexChange for the 22 row, it didn't seem to work. The error: Dim ddl As DropDownList = CType(sender, DropDownList)Dim dgi As DataGridItem = CType(ddl.Parent.Parent, DataGridItem)Dim rowID As Integer = dgi.ItemIndex The rowID keep staying at 20 even though the selectedIndexChanged is happening in row 22( ie. rowID should be 21)Does anyone seen this problem before??

View Complete Post

More Related Resource Links

Issue with Combobox - On selecting Item the combobox border becomes red why?

Hi, I have a combobox. <ComboBox DisplayMemberPath="Name" Name="CB" IsEnabled="{Binding ElementName=RB, Path=IsChecked}"<br/> SelectedValue="{Binding Path=Folders, Mode=TwoWay, UpdateSourceTrigger= PropertyChanged}" /> It has Selected value binding with ObservableCollection as public ObservableCollection<T> _folders; public ObservableCollection<T> Folders { get { return _folders; } set{ _folders = value; }} Combobox's IsEnabled property has binding with a Radio button checked value. PS: I don't have any validation here. The problem I am facing is when I select an Itam from Combobox its border becomes red , I don't understand why this is happening.

ASP.NET Events and Pageload not firing when Datagrid containing large number of rows of data

Hi All, I have a datagrid in aspx page.Inside of datagrid i am using around 15 controls such as Button,dropdownlist and text box controls.Once the datagrid binds then the events in the aspx page not firing.Issue occured when the number of rowsgreater than 500.The number of rows less then its works fine.If anybody knows the solution please let me know."Platform i am working on ASP.NET1.1"Regards Hareesh

How to display the number of versions that an item/document currently has?

Hello, If I enable versioning on a list, is there a way to display the number of versions in the version history for each item? Now I have to open the version history for each item to see how many versions there are. I need a quick overview in e.g. the view to see which items contain a lot of versions. Is that possible ?

Need help when selecting an item from one dropdown list it populates the 2nd dropdown on aspx page

Does anyone know how to do this so when I select something the 1st dropdown and the 2nd one becomes visible and populates list from a Select statement. I really need help on how to do in an aspx and not on the code behind page.

Need help when selecting an item from a dropdown list it makes the 2nd dropdown visible

Does anyone know how to do this so when I select something the 1st dropdown and the 2nd one becomes visible and populates list from a Select statement. How do you code this in Sharepoint Developer on an aspx page?

View All Site Content Showing the wrong number of items

NOTE:  Similar post also had no answer: http://social.msdn.microsoft.com/Forums/en-US/sharepointecm/thread/f775ba0d-648f-4be3-9017-78539915b281/ I am the Site Collection Administrator/and also tried logging in using Farm Account.  I go into View All Site Content and I show 15 documents.  When you actually go to the All Items view (and I double-checked, no filtering), you only find 9 documents.  Versioning is not turned on.  I am a developer, so I also used the Web Service to try to troubleshoot.  The Lists.asmx web service shows an Item Count of 15 using the GetList method.  However, using the GetListItems method, the item Count reports 9 items, which is what I see in my browser. Is there an stsadm command that I can run that will "true up" this number being reported in View All Site Content? Thanks in advance. - Update -  MOSS 2007 v 3.0 server farm.

How to convert the datagrid bound column item itself link to another detail page without using hyper

Dear experts, I would like to make the datagrid bound column to redirecting to the details page . For example , when my mouse over certain row of bound column in datagrid , it will change the colour to blue . Also , I can click anywhere of the row and the will redirect to the detail page . Can any expert help me on that ? Notes : I do not want to use hyperlink column and do not want to fix the text for every row. I want to use datafield, CommandName and CommandArguement. Thanks & Rgds

Selecting an Listview Item


May be I'm trying to run before I can walk, but here goes, I find coding for ASP so frustrating it's just not logical JIM!

Anyways after my rant, as I'm a huge fan of the listview control in WinForms I'm trying to get the hang of it in ASP, wth not much luck so far.

I've got several questions I hope you guys/girls can answer

I'm trying to make the listview winforms-e

Select Item then update/Delete as required

(A) how to actually select the item and ire the event and then pickit up again to update/delete the item of either button is pressed.

Also the following is a snippet of code I have that when your over the item you can select it which goes to another ASP page so it can be edited(when finished that is!).

                <tr style="background-color: #DCDCDC;" onmouseover="this.style.backgroundColor='#FFCCFF'"
                    <a href="Draw.aspx?ID=<%# Eval("ID")%>" style="text-decoration: none; color: rgb(0,0,0);">                  
                    <td style="text-align: right;">
                        <asp:Label ID="Draw" runat="server"><%#

Cumulative Update 5 - wrong SQL 2008 version number


Hi all,

I installed Service Pack 1 for SQL 2008 on one of my servers. This server has multiple instances. In this case, it is the instance "SHAREPOINT2010" that is giving me difficulties.

For Sharepoint 2010, we need to install cumulative update 5. This update fails due to the fact I do not have the correct SQL version. It is expecting version 10.0.2531 (SP1), but it says I have the 10.0.1600 (RTM). When I check in my management studio and via the @@version, I do see the confirmation I have version 10.0.2531. (also see attached screenshot).

Does anyone know why the cumulative update fails to see the correct server version ? If I try to install it on another SQL 2008 SP1, it works fine..;

Thank you !



screenshot sql version

DataGrid bound to empty (generic) collection can only add one item


Hi All,

I have a datagrid where the itemssource is bound to an typed observable collection:

ObservableCollection<ItemViewModel> Items;

Initially, the collection is empty (although not null). The datagrid shows me one row, and creates an item in the collection for me automatically. I can edit this row just fine.

However, there is no way of adding a new row. I believe this is because the grid only adds a row when I've finished editing the current one, and since there is but one row I cannot leave that row! I would like to add a fresh row as soon as the user begins editing the current one (bit like the windows forms datagridview).

How can I solve this problem?



Populating listbox2 values after selecting item of listbox1 in Infopath



In Infopath I have two listboxes say listbox1,listbox2.In listbox1 i have the items of list,now my requirement is as soon as i select first item in listbox1,listbox2 values should get populated from other.Please share me your ideas/relevant articles that you have

Thanks & Regards,


Thanks & Regards, Sudheer

Generate a dynamic number of custom report item instances in a report


Are there any solid examples/tutorials/demos of how to dynamically generate custom report item instances in a report based on the amount of rows in a data set?

Additionally I would like to insert these custom report items in a particular order based on a field in the data set.

Any help/pointers/articles would be appreciated!

Selecting Datagrid Row when Right mouse button is Pressed.


How can i select the datagrid row when i click the right mouse button. I need to show the context menu in the datagrid but i am able to generate the context menu but selected row i not changing.

How can i solve this issue.


Saugat K.C.

What's wrong with this databing on WPF Datagrid

I have one datagird embedded in a datagrid . 
The databing basiclly works fine .
But the embedded datagird didn't show the data ,but show the columns with empty.
What's wrong with my binding code ?
Thanks for any advice.

Below is my xaml code .
B is a Dictionary<string,object> data type  .If i replace the datagrid with listview ,it works fine .

<DataGrid ItemsSource="{Binding}"> <DataGrid.Columns> <DataGridTextColumn Binding="{Binding A}" Header="Column1" MinWidth="100"/> <DataGridTemplateColumn Header="Column2"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <DataGrid ItemsSource="{Binding B}" AutoGenerateColumns="True"/> </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> <DataGridTemplateColumn Header="2"> <DataGridTemplateColumn.CellTemplate> <DataTemplate> <ListView ItemsSource="{Binding B}"/> </DataTemplate> </DataGridTemplateColumn.CellTemplate> </DataGridTemplateColumn> </DataGrid.Colum

Is it Possible to Edit page number text in Datagrid(which clicked)


Hi,I have a datagrid.

I am editing the page links text  1 2 3 4 5 ...  as  1-10 11-20 21-30 31-40 ...succesfully.

But here the problem is when am clicking 21-30 link it changes to 3.

How to display the 3 as 21-30.

Custom ribbon button not showing when selecting item in webpart


Wondering if any one else seen this, I noticed custom ribbon buttons don't show up when I select item in document library in webpart view. Site is created using team site template and the webpart that shows contents of a document library is inside of a wiki editing control in team site home page

Button shows up correctly when I select the item once in document library view

Microsoft Certified Master | SharePoint 2007

whats wrong with this? decimal or whole number?!


here is my code, i am getting the data types wrong i think.

label 51 is a whole number from database, label52 could be a decimal number after the division is applied to label 51.

label 53 will be a decimal

label 54 will be a decimal, but id like to show it to the nearest whole number...

how can i get this to work? thanks!

FormView Formview1 = (FormView)sender;
        Label Label51 = Formview1.FindControl("Label51") as Label;
        Label Label52 = Formview1.FindControl("Label52") as Label;
        Label Label53 = Formview1.FindControl("Label53") as Label;
        Label Label54 = Formview1.FindControl("Label54") as Label;


        Label52.Text = (int.Parse(Label51.Text) / Convert.ToInt32("144")).ToString();
       Label53.Text = (double.Parse(Label52.Text) * Convert.ToInt32("100")).ToString();
        Label54.Text = (Convert.ToInt32("100") - int.Parse(Label53.Text)).ToString();

ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend