ItemType="VincitoreCRMApplication.Models.FloorPattern"
UpdateMethod="floorList_UpdateItem" DeleteMethod="floorList_DeleteItem"
SelectMethod="floorList_GetData" DataKeyNames="FloorPatternId"
Visible='<%# ShowFloorList %>' >
In Code behind, I have a Property in PAge named ShowFloorList :
public bool ShowFloorList { get; set; }
protected void Page_Init(object sender, EventArgs e)
{
if (!IsPostBack)
{
ShowFloorList = true;
}
}
protected void collapseFloorList_Click(object sender, EventArgs e)
{
System.Diagnostics.Debug.WriteLine("COLLAPSE FLOOR BTN Click Floor List State = " + floorList.Visible + " BTN TEXT = " + collapseFloorList.Text );
if (collapseFloorList.Text == "Hide") // Requesting to Hide i.e. Visible to make false
{
System.Diagnostics.Debug.WriteLine("INSIDE HIDE");
ShowFloorList = false;
System.Diagnostics.Debug.WriteLine("SHOWFLOOR LIST = " + ShowFloorList);
}
else
ShowFloorList = true;
/*
if (ShowFloorList == false)
{
collapseFloorList.Text = "Show";
ShowFloorList = false;
//floorPanel.Visible = false;
//floorList.Visible = false;
}
{
collapseFloorList.Text = "Hide";
ShowFloorList = true;
floorPanel.Visible = true;
//floorList.Visible = true;
} */
}
Logs on Execution :
COLLAPSE FLOOR BTN Click Floor List State = True BTN TEXT = Hide
INSIDE HIDE
SHOWFLOOR LIST = False
I tried making the floorLsit directly visible to false, adding it in a panel & making panel visible, and now alos thru property but Nothing works. Also tried changing ListButton to asp:Button, but yet same results. The button click event is fired, the value of ShowFloorList property is being changed to false, but the visibility of ListView doesn't change. It is visible always.
Can you tell me why am not able to hide the Listview ??
Any help is highly appreciated.
Thanks
6 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Khargesh RajputPosted Mar 24, 2015, 5:09 AM
write
below
floorList.Focus();
then as well as floorList visible then cursor will focus on
floorList
TerryPosted Mar 24, 2015, 9:45 AM
I tried this way :
First of all, their is no property like MaintainScrollPositionOnPostBack in ListView. I tried in aspx & also code behind. Additionally I also get a message while building
I tried looking for something like Scrol... , but didn't find any such property/method also.
Khargesh RajputPosted Mar 24, 2015, 7:36 AM
TerryPosted Mar 24, 2015, 7:16 AM
if the cursor is on floorList, then shouldn't that be visible straight on the page. The top of the page is seen, I want the page to come down to floorList so that is visible straight away, which doesn't happen with setting focus on it.
Floorlist only have Item & Edit templates.
TerryPosted Mar 24, 2015, 4:56 AM
Initially that's what I had tried with and it didn't worked. Adding the Visible property in if (! IsPostBack) did the trick. Here is what worked for me :
Now, when the listview is visible, I want the page to navigate (have Focus) to the list only. I mean, on clicking collapseFloorList button, the list is visible but the cursor is at top of the page. I want is, when it is set to visible = true, the cursor should be on the ListView instead of used navigating down till Listview. As you can see in code, after setting Visible to true, I have set Focus() on floorList. But the page comes on top only. For info, the floorList doesn't have insert template - if that has any affect on it. And ya, above the floorList I alos have a href like this :
Floor Pattern
Can you tell how can I have focus on floorList & the focus/cursor is directly on floorList when set it's Visible to true.
Thanks.
Khargesh RajputPosted Mar 23, 2015, 11:34 PM
either set panel floorPanel.visible=false;
or
listview
floorList.visible=false;