RadioButtons, ListViews, and Grouping, oh my! - asp.net

I've got a project I'm working on where I need to put a RadioButton inside a ListView, and have them all have the same GroupName. (can't use RadioButtonList, long story).
Anyway, this seems to be a well known bug in .NET, so I've implemented the solution found here:
ASP.NET RadioButton messing with the name (groupname)
This works perfectly, but with one small bug which undoubtedly will come back to bite me. If I click one radio button, and then click another while the javascript function is still running and has not completed; I can get 2 radiobuttons in the same group selected.
Any ideas? If you need clarification; leave me a comment and I'll update my post.
EDIT: I believe I fixed my own issue here. See my posted answer below.

Would something like this work?
if (!rbClicked)
rbClicked=True;
runJavascript();
rbClicked=False;
I admit I didn't do alot of research, but this is how I've usually solved this type of problem.

Turns out I was misguided here.
Later on in the page lifecycle; I was adding an additional onclick event that was overwriting the previous value.
In the following example:
var radiobutton = new System.Web.UI.WebControls.RadioButton();
radiobutton.Attributes.Add("onclick", "test1");
radiobutton.Attributes.Add("onclick", "test2");
the onlcick attribute is set to "test2"; test1 is lost.
I ended up fixing it by appending to the existing attribute; see below:
radiobutton.Attributes["onclick"] = string.Format("{0};{1}", radiobutton.Attributes["onclick"], "My Second Script");
This works without issue.

Related

Multiple functions to be render in Clicked EditCommandTemplate DataGrid Blazorise

on edit the bit should be true and also context.clicked should also work
this is not working
Clicked="#(()=> OnEditBtn(context))"
First of all, I am not quite sure what is your problem, you could try to expand on your question.
Secondly if your problem is not showing some component after changing variable, try to call StateHasChanged() to redraw component, if your OnEditBtn function is the bound function in <Button Clicked=#..., could be the issue.
But I am just guessing with what I have to work with.

Vertical Resource View: custom HTML resources and time slot clicks

Researching https://fullcalendar.io/docs/vertical-resource-view for work
It seems the columnHeaderHtml callback does not work for this view.
https://github.com/fullcalendar/fullcalendar-scheduler/issues/429
Is this still the case? Any way around this?
I also need the ability to click a timeslot. Eg. clicking the 10 AM row to create an event at 10 AM. Does this functionality exist? I can't seem to find any callbacks that seem to work.
My codepen so far:
https://codepen.io/anon/pen/OKyvGZ?editors=0010
EDIT: #ADyson pointed out that columnHeaderHtml only works for date headers, not resource headers as is the case here.

2 Modal Popups - properties being switched when ajax script runs

While I was typing this I figured out what was causing my issue, but I haven't figured out why it was causing an issue, and it seems strange to me. Maybe someone could explain... Here is my situation (question is at the bottom):
I have 2 modal popups.
PopupControlID as follows:
popup1
popup2
calling from server side code:
popup1.Show() 'works fine
popup2.Show() 'works fine
at some point though:
popup1.Show() 'inspecting on server side all properties definitely belong to
'popup1, but when the ajax .js is triggered, popup2
'property values are being used
Everything was set up properly for these controls to run, but something outside of their setup was cauing a problem.
In page_load I was setting the target popup control for popup2 (which was a div) to .Visible = False. When I noticed this code I deleted it because it was unnecessary since I knew the target control was hidden using style="display:none;". After removing this, I ran the code, not expecting this to fix the bug, but the conflict disappeared. I do not understand how this could affect my pop ups in such a manner.
THE QUESTION:
Does anybody know why popup1.Show() would go ahead and use popup2's properties instead of it's own in the ajax script, just because at some point in the code the target control of popup2 was set to .visible = false?
In replicating my issue it seems the answer is as simple as this:
Any time you set a control to .Visible = "False" that is also the PopupControlID of a modal popup extender it will cause an error and the page will not load. I feel kinda stupid for now realizing this up front, a real "duh" moment...
Anyway, pretty basic stuff when I realized what was happening. Here is an article related to this issue:
http://blog.matthewdoyle.net/2008/10/13/visiblefalse-vs-displaynone/

Why won't this checkbox refresh as expected in Meteor?

I'd like to simplify the TodoMVC app for meteor. There is currently some observe that should not be needed I think. I simplified a bit successfully, but when I try to simplify it further the updating doesn't work properly.
For instance, it should get selected when I click on all the items in the todo list but doesn't. When I refresh the page it is selected though.
Edit: Got rid of an unrelated error, thanks to #TomColeman.
I'm seeing that error before the patch is applied. It's due to the Meteor.flush on line 74.
I'm not sure why that flush is needed? (I'm also not sure why there's an error either).
Turns out it simply was because the correct html is checked="checked", not simply checked.

How to turn on line number tooltip while scrolling infragistics ultrawebgrid

I once saw this feature in action but I don't know how to turn it on. The grid can show a tooltip with the current row number (or row ID) while dragging the scrollbar. This helps you to stop the scroll in the right place. I'm assuming some property will turn this on, but I can't find it.
Maybe it is also dependent on the scroll mode?
UPDATE:
In the image below you can see an example of the tooltip I'm looking for. This is displayed while the scrollbar is being dragged (up or down). The number in the tooltip is the row number (you can't see it in this image, way to the left in the grid). This is the same grid that I am using now. Just from a very old build of our product. Somehow this tooltip was turned off. And no one knows how to turn it back on :(
I'm pretty sure this is a built in feature of the ultrawebgrid. Not something that required extra coding.
alt text http://img138.imageshack.us/img138/6337/croppercapture.jpg
Right! Now that we've established that you have version 6.3, I've hopefully got a solution for you. I don't have 6.3 myself, but I've got a slightly later one that I think didn't have Virtual Scrolling added as a feature yet.
So try this code:
webgrid.DisplayLayout.XmlLoadOnDemandType = XmlLoadOnDemandType.Virtual;
This should automatically put a tooltip on the grid as you scroll down. Have a look here for a running sample... (and remember to choose the virtual option)
Here's hoping!
Rob G
I don't know if there's a UltraWebGrid property to simply turn on the behavior you're looking for. I almost suspect you experienced this feature in another application, perhaps not even a web based one (sorry!). I do however, know exactly what you're talking about.
As a work-around, I would suggest allowing the user to input the destination row number, and to simply "jump" to it, using this technique.
If that doesn't satisfy you, it may be possible to achieve this behavior with JavaScript. You would need to use something like this technique to get the information you need, estimate (or actually detect, if possible) the row number, and the rest is up to the GUI. I would go with the work-around described above though :)
I'm typing this from memory here as I don't have it installed on this machine and I haven't seen that setting before, but how about adding something like this to the InitializeRow event:
foreach (UltraGridCell cell in e.Row.Cells)
{
if(cell.Column.Key == "Topic") //from your grid above
cell.Title = cell.Row.Index;
}
The row object itself does not have a "Title" property from memory, but the cell does.
See if that works...
Regards,
Rob G
OK - I think I've found your illusive setting:
You can set the TipStyleScroll on the Override to Show on the Grid (this may be version dependant).
You can determine which field is displayed as the tooltip by using the ScrollTipField property of the band.
I did it like so:
myGrid.DisplayLayout.Override.TipStyleScroll = TipStyle.Show;
myTopBand.ScrollTipField = "Id";
...and it works like a charm!
If it's a really long list, sometimes setting the ScrollStyle to Deferred helps:
myGrid.DisplayLayout.ScrollStyle = ScrollStyle.Deferred;
Hope that helps...
Rob G
Once again - not sure which version you have, so to be safe here's somthing you can try from 2009 version:
myGrid.Behaviors.VirtualScrolling.Enabled = true;
myGrid.Behaviors.VirtualScrolling.TooltipVisibility = DefaultableBoolean.True;
If your scrolling mode is Deferred instead of Virtual, then the tooltip is normally enabled by default.
You can find full details about this feature here
Hope that helps,
Rob G

Resources