Welcome Guest Search | Active Topics | Sign In | Register

Web Grid.CheckedItems Not working Options
ROI.Solutions
Posted: Wednesday, May 14, 2008 10:51:08 AM
Rank: Advanced Member
Groups: Member

Joined: 4/22/2008
Posts: 75
OK,
I copied and pasted from the check Box column demo and it not working for me. its doesnt detec that a cell have gone form unchecked to a checked state. I have 2 cells form my Db that im testing it with. I have spent some time on this any ideas whats going wrong. Here is sample code

Code: Visual Basic.NET
Protected Sub btnUpdateAssociations_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpdateAssociations.Click
        Dim item As EO.Web.GridItem
        For Each item In sAssociationGrid.CheckedItems
            MsgBox("Test")
        Next item
    End Sub
eo_support
Posted: Wednesday, May 14, 2008 11:06:10 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,218
Loren wrote:
I copied and pasted from the check Box column demo and it not working for me.

The sample works as is. So in order to trouble shoot the problem, we definitely need you to compare the sample and your code to find out the difference. Do it step by step and it should not be difficult to find out the triggering point.


Loren wrote:
its doesnt detec that a cell have gone form unchecked to a checked state.

Can you elaborate what you mean by that? How do you know it does detects a cell have gone from unchecked to a checked state?

Loren wrote:

I have 2 cells form my Db that im testing it with. I have spent some time on this any ideas whats going wrong. Here is sample code

Code: Visual Basic.NET
Protected Sub btnUpdateAssociations_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnUpdateAssociations.Click
        Dim item As EO.Web.GridItem
        For Each item In sAssociationGrid.CheckedItems
            MsgBox("Test")
        Next item
    End Sub

Your code looks fine to us except that we do not know what MsgBox does for you. The only thing we can think of is, CheckedItems returns all items that are checked on the FIRST CheckBoxColumn, so if you have multiple CheckBoxColumns, other columns will have no effect on CheckItems. In that case you need to walk through all items and check the cell values on that specific column.

Thanks
eo_support
Posted: Wednesday, May 14, 2008 11:07:20 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,218
BTW: We have sent you a new build yesterday. Please check your private messages for details.
ROI.Solutions
Posted: Wednesday, May 14, 2008 11:19:03 AM
Rank: Advanced Member
Groups: Member

Joined: 4/22/2008
Posts: 75
OK,

If i change
Code: Visual Basic.NET
For Each item In sAssociationGrid.CheckedItems

-TO-
Code: Visual Basic.NET
For Each item In sAssociationGrid.ChangedItems


I get the MsgBox as expected. The message Box is just being used to test and see if it runs as expected. Which it isnt.

What im trying to do is a user select down the list which items to cheeck. I then want to loop through all checked Items and update my database. The only think i can this of is that the checkbox is having issue becuase it has a datasource. I pull a bit field of 1 or 0 if one it makes the check box as Checked as works. let me test to see if i remove the DataFiled property and if it works if so this maybe another but like the button text one i submitted.
ROI.Solutions
Posted: Wednesday, May 14, 2008 11:21:15 AM
Rank: Advanced Member
Groups: Member

Joined: 4/22/2008
Posts: 75
Nope it still isnt working. The demo on the site works but when i make a test project and identical it isntwortk on my build version
eo_support
Posted: Wednesday, May 14, 2008 11:25:41 AM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,218
Hi Loren,

There is no reason for identical code to produce different result. So something must be different somewhere, either directly in your code or in your project. Try load and run our sample project directly and see what you get.

Thanks
ROI.Solutions
Posted: Wednesday, May 14, 2008 11:47:55 AM
Rank: Advanced Member
Groups: Member

Joined: 4/22/2008
Posts: 75
OK works when i create a new project on the new build only. I will work on it and get back to you if needed. Thnx for the quick build and the fix for the SQLData Sources and binding them
ROI.Solutions
Posted: Wednesday, May 14, 2008 11:53:46 AM
Rank: Advanced Member
Groups: Member

Joined: 4/22/2008
Posts: 75
Having Issues with the new Build i was sent. Now it works fine for the DataSourceID so that i dont have to manually bind it be now i can add my static menu Items anymore. only the DtatSource items show up.

EDITED:

If i manually databind it works again. I was told it would auto databind but thats ok.
eo_support
Posted: Wednesday, May 14, 2008 12:00:09 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,218
That's normal. Data binding always wipe out everything and recreate it from the database. Automatic data binding occurs rather late so it happens after you add the static menu items. The workaround for this situation is to call DataBind before adding your static items. The difference with the new build is that you no longer need to set DataSource when you have already set DataSouceID.
ROI.Solutions
Posted: Wednesday, May 14, 2008 12:08:26 PM
Rank: Advanced Member
Groups: Member

Joined: 4/22/2008
Posts: 75
Ok but im still having the Grid issue detecting the ItemsChecked. it works on the Same project if i do something like grid.Changeditems or Grid.Itesm but not CheckedItems. Can we do the Web Chat and i show you whats happening?
eo_support
Posted: Wednesday, May 14, 2008 12:16:37 PM
Rank: Administration
Groups: Administration

Joined: 5/27/2007
Posts: 24,218
Of course. Please check your PM for meeting link.


You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.