check box in asp.net webform - asp.net

I need help in check box my problem that when i select any one it gave me message
about my selection but when choose two of check box gave me the last choose of them why and what is the fix please

What is happening is that your Append status is wrong. Instead of appending, you are overwriting the current value. Hence when you choose say two answers, the first is overwritten by the second.
I think the problem is with the syntax of your Append status. Instead of:
Append(Label5.Text =("New Text"));
It should be something like:
Append(Label5.Text).Append("Your new text");
See:
https://msdn.microsoft.com/en-us/library/b4sc8ca8(v=vs.110).aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-1

Related

Qt 6 crash in QPlainText::setExtraSelections after QPlainText::setDocument

I'm trying to set up a text widget that highlights the searched word, when I open a new file with QPlainText::setDocument, then immediately use QPlainText::setExtraSelections I get a SIGSEV crash in:
QTextDocumentPrivate::rootFrame
QTextDocumentPrivate::frameAt
QTextCursorPrivate::complexSelectionTable
QTextCursor::hasComplexSelection
QWidgetTextControl::selectionRect
QWidgetTextControl::setExtraSelections
QTextDocumentPrivate is causing a SIGSEV because it is a null this pointer. But this doesn't happen if no word is set before the document is loaded.
I must be supposed to do something to force it to generate the QTextDocumentPrivate. But I have no idea what that is.
Actually, this happens because QPlainText::setDocument does not remove the prior results of QPlainText::setExtraSelections. So when setting the new selections tries to remove the previous things selected, they all have invalid pointers and that causes the crash.
To fix it call: textEdit->setExtraSelections({}); to clear out the selections prior to calling QPlainText::setDocument.

Is it possible to show all options in Tokenize2?

Tokenize2 is a javacsript lib to select multiple options.
It provides a very neat UI to start writing and then get a list of options to select from. Selected options will show up as "tags" that can be removed with "x" link.
So far all is fine. But Right now you need to know what your looking for and start write at least one character to see matching alternatives.
In my scenario there are very few alternatives and they are not known to the user. I would like to show ALL options when the user clicks the input box. There is a configuration option named searchMinLength but it is already set to 0.
Is there a workaround that can be used? Maybe like triggering load and dropdown manually?
I know there are a lot of similar alternatives but I picked Tokenize2 because:
It looks clean and nice
It works in mobile browsers
I don't know if there is an "official" approach, but after some investigation I have found an acceptable workaround.
After downloading the Tokenizer2 sourceode I found the following line that triggered my attention:
if(this.input.val().length > 0){
this.trigger('tokenize:search', [this.input.val()]);
}
My interpretation is that the internal search command is not triggered unless the user input has at least one character. This line in sourcecode could easily be modified. I have filed a suggestion for this here: https://github.com/zellerda/Tokenize2/issues/26
My current workaround is to add an event listener for the select event and there trigger the internal search command. That works fine for my scenario and does not force a source code rewrite.
$("#my-dropdown").on("tokenize:select", function (e: Event, routedEvent: boolean) {
$("#my-dropdown").trigger('tokenize:search', "");
});
Tokenize2
This link worked for me GitHub
$('.tokenize-sample-demo1').on('tokenize:select', function(container){
$(this).tokenize2().trigger('tokenize:search', [$(this).tokenize2().input.val()]);
});

Telerik RadGrid: Show column only in edit mode?

I'd like to "hide" one column in my RadGrid and only have it show when I'm in edit mode. I tried just moving it into the edit item template, but that didn't work at all.
Any suggestions would be deeply appreciated!
Thank you!
Oy...
"Paul's Third Law of Asking For Help
You will discover the obscure answer 5 minutes after giving up and asking for advice."
Turns out you set the column to "Display=False" but only if you are in popup or edit form mode, not inline.
Hope it helps someone else.
Even though you did answer this yourself I thought I'd write an answer to clarify some things.
You can set the default value of the EditColumn to be false, even in InPlace edit. However it makes it a lot more difficult to save edited data as the InPlace edit (for simplicity) requires the EditColumn to display the save or cancel items.
That being said, you can do it - however you need to use explicit CommandNames on the items:
Say you want to Update a row with the new values you have inserted in the InPlace edit. Then the confirm button's CommandName would HAVE to be "Update" to be picked up correctly.
All of this being said, it would be a lot simpler for you to keep the EditColumn intact even when in InPlace (editmode).
Or you could specify the EditTemplate for one column to widen the column, add the two buttons necessary to perform Update and Cancel as well as hiding the EditColumn so that multiple InPlaceEdits can't be performed at the same time. :)
I hope this helps someone, as I was stuck in a similar situation myself when I had to incorporate both InPlace and EditForms EditModes on a single RadGrid and knowing the above information made a WORLD of difference.
You can try this:
var agtype = $telerik.$(atCell).text().trim();
if(agtype == ""Guaranty""){{
var masterTableView = sender.get_masterTableView();
var columnIndex = masterTableView.getColumnByUniqueName(""Amount"").get_element().cellIndex;
masterTableView.showColumn(columnIndex);
}}

Filter at event viewer by data

I want to get event entries by their description (data).
I know how to get the event entry with a certain description, however I want to get an entry whith a description which contains a string (not equals to it).
That, I don't know how to do.
Please help :)
According to my answer here: https://stackoverflow.com/a/34119006/5089204 you should be able to retrieve EventRecords.
Dealing with these events is a quite complex issue... Each event has its own internal structure. The common properties are bundled in EventRecord, but the specific data must be taken from the internal details. Use the ToXml() method of an EventRecord...
In order to get the right events you must define an EventLogQuery. You must know the Provider's name and specify the filter.
Try the following: Open eventvwr and there the Windows-System queue. Right click one event, open the "Details" and choose the "XML-View". Look over different events and you will find, that they are quite differing.
But: You'll find everything you need there: First the "Provider Name" and the "EventId", these two are most important for the `EventLogQuery'.
Now go to the "define a user filter on the current protocoll"-action and type in some values. Then switch to the filter's XML and you'll learn how to define the correct query.
I'm sorry, there is no "easy and general" approach :-)

how to use QTable::editCell()

I don't understand how QTable::editCell() should be used. I am trying to do some error checking based on entries made by user in a QTable as mentioned in my another question.
I would like to give user an opportunity to re-edit the cell which has error. For example, if name column entry has some special characters such as '(', the user should be prompted for the error and the control should go back to same cell in edit mode. I tried using QTable::editCell() in my code as shown below.
Table->editCell(row, 0, TRUE);
name = Table->text(row, 0);
However, this doesn't work as expected. The control doesn't stay in the cell at all and obviously the name is not correctly collected. So, my question is how to ensure from within code that a cell of QTable can be edited so that the edited contents can be accessed immediately in next statement (as shown in above code).
Note: I am working with qt 3.3.8 only.
I don't think you can do that. You'll have to go back to the event loop, and wait for one of the signals (like valueChanged(row,col)) to be fired to re-validate the data.
A blocking wait on a GUI object is often not a good approach (except for modal dialogs).
I know I'm a little late here but you should use the following connect statement with your own custom function to do your specific needs such as below. You can also use this method to disable users from entering in special characters within you custom function. That way they wont ever have to correct undesirable characters.
connect(ui->tableWidget, SIGNAL(cellChanged(int,int)), this, SLOT(customFunction(int,int)));
void updateTable
{
//remove invalid characters
}

Resources